Skip to content

edsnlp.pipelines.ner.adicap.factory

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

create_component(nlp, name, pattern, prefix, window, attr)

Source code in edsnlp/pipelines/ner/adicap/factory.py
10
11
12
13
14
15
16
17
18
19
20
21
22
23
@Language.factory(
    "eds.adicap",
    default_config=DEFAULT_CONFIG,
    assigns=["doc.ents", "doc.spans"],
)
def create_component(
    nlp: Language,
    name: str,
    pattern: Optional[Union[List[str], str]],
    prefix: Optional[Union[List[str], str]],
    window: int,
    attr: str,
):
    return Adicap(nlp, pattern=pattern, attr=attr, prefix=prefix, window=window)