[cad161]: / tests / connectors / test_labeltool.py

Download this file

22 lines (14 with data), 461 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
from edsnlp.connectors.labeltool import docs2labeltool
texts = [
"Le patient est malade",
"Le patient n'est pas malade",
"Le patient est peut-être malade",
"Le patient dit qu'il est malade",
]
def test_docs2labeltool(nlp):
modifiers = ["negated", "hypothesis", "reported_speech"]
docs = list(nlp.pipe(texts))
df = docs2labeltool(docs, extensions=modifiers)
assert len(df)
df = docs2labeltool(docs)
assert len(df)