Skip to content

edsnlp.pipelines.core.sentences.factory

DEFAULT_CONFIG = dict(punct_chars=None, ignore_excluded=True, use_endlines=None) module-attribute

create_component(nlp, name, punct_chars, use_endlines, ignore_excluded)

Source code in edsnlp/pipelines/core/sentences/factory.py
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
@deprecated_factory(
    "sentences",
    "eds.sentences",
    default_config=DEFAULT_CONFIG,
    assigns=["token.is_sent_start"],
)
@Language.factory(
    "eds.sentences",
    default_config=DEFAULT_CONFIG,
    assigns=["token.is_sent_start"],
)
def create_component(
    nlp: Language,
    name: str,
    punct_chars: Optional[List[str]],
    use_endlines: Optional[bool],
    ignore_excluded: bool,
):
    return SentenceSegmenter(
        nlp.vocab,
        punct_chars=punct_chars,
        use_endlines=use_endlines,
        ignore_excluded=ignore_excluded,
    )