Skip to content

edsnlp.pipelines.ner.drugs.factory

DEFAULT_CONFIG = dict(attr='NORM', ignore_excluded=False) module-attribute

create_component(nlp, name, attr, ignore_excluded)

Source code in edsnlp/pipelines/ner/drugs/factory.py
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
@Language.factory("eds.drugs", default_config=DEFAULT_CONFIG)
def create_component(
    nlp: Language,
    name: str,
    attr: str,
    ignore_excluded: bool,
):
    return TerminologyMatcher(
        nlp,
        label="drug",
        terms=patterns.get_patterns(),
        regex=dict(),
        attr=attr,
        ignore_excluded=ignore_excluded,
    )