()
| 812 | |
| 813 | |
| 814 | def test_debug_data_compile_gold(): |
| 815 | nlp = English() |
| 816 | pred = Doc(nlp.vocab, words=["Token", ".", "New", "York", "City"]) |
| 817 | ref = Doc( |
| 818 | nlp.vocab, |
| 819 | words=["Token", ".", "New York City"], |
| 820 | sent_starts=[True, False, True], |
| 821 | ents=["O", "O", "B-ENT"], |
| 822 | ) |
| 823 | eg = Example(pred, ref) |
| 824 | data = _compile_gold([eg], ["ner"], nlp, True) |
| 825 | assert data["boundary_cross_ents"] == 0 |
| 826 | |
| 827 | pred = Doc(nlp.vocab, words=["Token", ".", "New", "York", "City"]) |
| 828 | ref = Doc( |
| 829 | nlp.vocab, |
| 830 | words=["Token", ".", "New York City"], |
| 831 | sent_starts=[True, False, True], |
| 832 | ents=["O", "B-ENT", "I-ENT"], |
| 833 | ) |
| 834 | eg = Example(pred, ref) |
| 835 | data = _compile_gold([eg], ["ner"], nlp, True) |
| 836 | assert data["boundary_cross_ents"] == 1 |
| 837 | |
| 838 | |
| 839 | @pytest.mark.parametrize("component_name", ["spancat", "spancat_singlelabel"]) |
nothing calls this directly
no test coverage detected
searching dependent graphs…