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

Function test_debug_data_trainable_lemmatizer_partial

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

Source from the content-addressed store, hash-verified

1170
1171
1172def test_debug_data_trainable_lemmatizer_partial():
1173 partial_examples = [
1174 # partial annotation
1175 ("She likes green eggs", {"lemmas": ["", "like", "green", ""]}),
1176 # misaligned partial annotation
1177 (
1178 "He hates green eggs",
1179 {
1180 "words": ["He", "hat", "es", "green", "eggs"],
1181 "lemmas": ["", "hat", "e", "green", ""],
1182 },
1183 ),
1184 ]
1185 nlp = Language()
1186 train_examples = []
1187 for t in partial_examples:
1188 train_examples.append(Example.from_dict(nlp.make_doc(t[0]), t[1]))
1189
1190 data = _compile_gold(train_examples, ["trainable_lemmatizer"], nlp, True)
1191 assert data["partial_lemma_annotations"] == 2
1192
1193
1194def test_debug_data_trainable_lemmatizer_low_cardinality():

Callers

nothing calls this directly

Calls 5

make_docMethod · 0.95
LanguageClass · 0.90
_compile_goldFunction · 0.90
appendMethod · 0.80
from_dictMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…