Skip to content

edsnlp.pipelines.ner.scores.tnm.factory

DEFAULT_CONFIG = dict(pattern=None, attr='TEXT') module-attribute

create_component(nlp, name, pattern, attr)

Source code in edsnlp/pipelines/ner/scores/tnm/factory.py
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
@Language.factory(
    "eds.TNM",
    default_config=DEFAULT_CONFIG,
    assigns=["doc.ents", "doc.spans"],
)
def create_component(
    nlp: Language,
    name: str,
    pattern: Optional[Union[List[str], str]],
    attr: str,
):
    return TNM(
        nlp,
        pattern=pattern,
        attr=attr,
    )