Diff of /tests/helpers.py [000000] .. [cad161]

Switch to unified view

a b/tests/helpers.py
1
import spacy
2
3
import edsnlp
4
5
6
def make_nlp(lang):
7
    if lang == "eds":
8
        model = spacy.blank("eds")
9
    else:
10
        model = edsnlp.blank("fr")
11
12
    model.add_pipe("eds.normalizer")
13
14
    model.add_pipe("eds.sentences")
15
    model.add_pipe("eds.sections")
16
17
    model.add_pipe(
18
        "eds.matcher",
19
        config=dict(
20
            terms=dict(patient="patient"),
21
            attr="NORM",
22
            ignore_excluded=True,
23
        ),
24
    )
25
    model.add_pipe(
26
        "eds.matcher",
27
        name="matcher2",
28
        config=dict(
29
            regex=dict(anomalie=r"anomalie"),
30
        ),
31
    )
32
33
    model.add_pipe("eds.hypothesis")
34
    model.add_pipe("eds.negation")
35
    model.add_pipe("eds.family")
36
    model.add_pipe("eds.history")
37
    model.add_pipe("eds.reported_speech")
38
39
    model.add_pipe("eds.dates")
40
    model.add_pipe("eds.quantities")
41
42
    return model