Skip to content

edsnlp.pipelines.misc.dates.factory

DEFAULT_CONFIG = dict(absolute=None, relative=None, duration=None, false_positive=None, detect_periods=False, detect_time=True, on_ents_only=False, as_ents=False, attr='LOWER') module-attribute

create_component(nlp, name, absolute, relative, duration, false_positive, on_ents_only, detect_periods, detect_time, as_ents, attr)

Source code in edsnlp/pipelines/misc/dates/factory.py
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
@deprecated_factory(
    "dates", "eds.dates", default_config=DEFAULT_CONFIG, assigns=["doc.spans"]
)
@Language.factory("eds.dates", default_config=DEFAULT_CONFIG, assigns=["doc.spans"])
def create_component(
    nlp: Language,
    name: str,
    absolute: Optional[List[str]],
    relative: Optional[List[str]],
    duration: Optional[List[str]],
    false_positive: Optional[List[str]],
    on_ents_only: Union[bool, List[str]],
    detect_periods: bool,
    detect_time: bool,
    as_ents: bool,
    attr: str,
):
    return Dates(
        nlp,
        absolute=absolute,
        relative=relative,
        duration=duration,
        false_positive=false_positive,
        on_ents_only=on_ents_only,
        detect_periods=detect_periods,
        detect_time=detect_time,
        as_ents=as_ents,
        attr=attr,
    )