Test that labels are inferred correctly when there's a - in label.
()
| 158 | |
| 159 | |
| 160 | def 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) |
nothing calls this directly
no test coverage detected
searching dependent graphs…