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

Function test_debug_data_trainable_lemmatizer_basic

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

Source from the content-addressed store, hash-verified

1154
1155
1156def test_debug_data_trainable_lemmatizer_basic():
1157 examples = [
1158 ("She likes green eggs", {"lemmas": ["she", "like", "green", "egg"]}),
1159 ("Eat blue ham", {"lemmas": ["eat", "blue", "ham"]}),
1160 ]
1161 nlp = Language()
1162 train_examples = []
1163 for t in examples:
1164 train_examples.append(Example.from_dict(nlp.make_doc(t[0]), t[1]))
1165
1166 data = _compile_gold(train_examples, ["trainable_lemmatizer"], nlp, True)
1167 # ref test_edit_tree_lemmatizer::test_initialize_from_labels
1168 # this results in 4 trees
1169 assert len(data["lemmatizer_trees"]) == 4
1170
1171
1172def test_debug_data_trainable_lemmatizer_partial():

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…