MCPcopy
hub / github.com/explosion/spaCy / test_debug_data_compile_gold

Function test_debug_data_compile_gold

spacy/tests/test_cli.py:814–836  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

812
813
814def test_debug_data_compile_gold():
815 nlp = English()
816 pred = Doc(nlp.vocab, words=["Token", ".", "New", "York", "City"])
817 ref = Doc(
818 nlp.vocab,
819 words=["Token", ".", "New York City"],
820 sent_starts=[True, False, True],
821 ents=["O", "O", "B-ENT"],
822 )
823 eg = Example(pred, ref)
824 data = _compile_gold([eg], ["ner"], nlp, True)
825 assert data["boundary_cross_ents"] == 0
826
827 pred = Doc(nlp.vocab, words=["Token", ".", "New", "York", "City"])
828 ref = Doc(
829 nlp.vocab,
830 words=["Token", ".", "New York City"],
831 sent_starts=[True, False, True],
832 ents=["O", "B-ENT", "I-ENT"],
833 )
834 eg = Example(pred, ref)
835 data = _compile_gold([eg], ["ner"], nlp, True)
836 assert data["boundary_cross_ents"] == 1
837
838
839@pytest.mark.parametrize("component_name", ["spancat", "spancat_singlelabel"])

Callers

nothing calls this directly

Calls 2

EnglishClass · 0.90
_compile_goldFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…