This commit is contained in:
Adriane Boyd 2023-06-02 19:57:06 +02:00
parent bb62ee9450
commit 024679c17f

View File

@ -411,9 +411,7 @@ def test_preset_spans_suggester():
docs = [nlp("This is an example."), nlp("This is the second example.")] docs = [nlp("This is an example."), nlp("This is the second example.")]
docs[0].spans[SPAN_KEY] = [docs[0][3:4]] docs[0].spans[SPAN_KEY] = [docs[0][3:4]]
docs[1].spans[SPAN_KEY] = [docs[1][0:4], docs[1][3:5]] docs[1].spans[SPAN_KEY] = [docs[1][0:4], docs[1][3:5]]
suggester = registry.misc.get("spacy.preset_spans_suggester.v1")( suggester = registry.misc.get("spacy.preset_spans_suggester.v1")(spans_key=SPAN_KEY)
spans_key=SPAN_KEY
)
candidates = suggester(docs) candidates = suggester(docs)
assert type(candidates) == Ragged assert type(candidates) == Ragged
assert len(candidates) == 2 assert len(candidates) == 2