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

Function test_empty_docs

spacy/tests/test_models.py:217–227  ·  view source on GitHub ↗
(model_func, kwargs)

Source from the content-addressed store, hash-verified

215
216@pytest.mark.parametrize("model_func,kwargs", [(StaticVectors, {"nO": 128, "nM": 300})])
217def test_empty_docs(model_func, kwargs):
218 nlp = English()
219 model = model_func(**kwargs).initialize()
220 # Test the layer can be called successfully with 0, 1 and 2 empty docs.
221 for n_docs in range(3):
222 docs = [nlp("") for _ in range(n_docs)]
223 # Test predict
224 model.predict(docs)
225 # Test backprop
226 output, backprop = model.begin_update(docs)
227 backprop(output)
228
229
230def test_init_extract_spans():

Callers

nothing calls this directly

Calls 5

EnglishClass · 0.90
nlpFunction · 0.70
backpropFunction · 0.70
initializeMethod · 0.45
predictMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…