[cad161]: / tests / pipelines / ner / test_covid.py

Download this file

14 lines (10 with data), 369 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
def test_covid(blank_nlp):
examples = [
("Patient admis pour coronavirus", "coronavirus"),
("Patient admis pour pneumopathie à coronavirus", "pneumopathie à coronavirus"),
]
blank_nlp.add_pipe("eds.covid")
for example, text in examples:
doc = blank_nlp(example)
covid = doc.ents[0]
assert covid.text == text