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

Function test_labels_from_BILUO

spacy/tests/parser/test_ner.py:160–175  ·  view source on GitHub ↗

Test that labels are inferred correctly when there's a - in label.

()

Source from the content-addressed store, hash-verified

158
159
160def test_labels_from_BILUO():
161 """Test that labels are inferred correctly when there's a - in label."""
162 nlp = English()
163 ner = nlp.add_pipe("ner")
164 ner.add_label("LARGE-ANIMAL")
165 nlp.initialize()
166 move_names = [
167 "O",
168 "B-LARGE-ANIMAL",
169 "I-LARGE-ANIMAL",
170 "L-LARGE-ANIMAL",
171 "U-LARGE-ANIMAL",
172 ]
173 labels = {"LARGE-ANIMAL"}
174 assert ner.move_names == move_names
175 assert set(ner.labels) == labels
176
177
178@pytest.mark.issue(4267)

Callers

nothing calls this directly

Calls 4

EnglishClass · 0.90
add_pipeMethod · 0.80
add_labelMethod · 0.45
initializeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…