spaCy/spacy/tests/regression/test_issue4924.py
adrianeboyd ce0e538068
Check whether doc is instantiated in Example.get_gold_parses() (#5167)
* Check whether doc is instantiated

When creating docs to pair with gold parses, modify test to check
whether a doc is unset rather than whether it contains tokens.

* Restore test of evaluate on an empty doc

* Set a minimal gold.orig for the scorer

Without a minimal gold.orig the scorer can't evaluate empty docs. This
is the v3 equivalent of #4925.
2020-03-29 13:57:00 +02:00

9 lines
152 B
Python

import pytest
from spacy.language import Language
def test_issue4924():
nlp = Language()
docs_golds = [("", {})]
nlp.evaluate(docs_golds)