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