Skip to content

Hemiplegia

The eds.hemiplegia pipeline component extracts mentions of hemiplegia.

Details of the used patterns
# fmt: off
main_pattern = dict(
    source="main",
    regex=[
        r"hemiplegi",
        r"tetraplegi",
        r"quadriplegi",
        r"paraplegi",
        r"neuropathie.{1,25}motrice.{1,30}type [5V]",
        r"charcot.?marie.?tooth",
        r"locked.?in",
        r"syndrome.{1,5}(enfermement|verrouillage)|(desafferen)",
        r"paralysie.{1,10}hemicorps",
        r"paralysie.{1,10}jambe",
        r"paralysie.{1,10}membre",
        r"paralysie.{1,10}cote",
        r"paralysie.{1,5}cerebrale.{1,5}spastique",
    ],
    regex_attr="NORM",
)

acronym = dict(
    source="acronym",
    regex=[
        r"\bLIS\b",
        r"\bNMSH\b",
    ],
    regex_attr="TEXT",
)

default_patterns = [
    main_pattern,
    acronym,
]
# fmt: on

Extensions

On each span span that match, the following attributes are available:

  • span._.detailed_status: set to "PRESENT"

Examples

import edsnlp, edsnlp.pipes as eds

nlp = edsnlp.blank("eds")
nlp.add_pipe(eds.sentences())
nlp.add_pipe(
    eds.normalizer(
        accents=True,
        lowercase=True,
        quotes=True,
        spaces=True,
        pollution=dict(
            information=True,
            bars=True,
            biology=True,
            doctors=True,
            web=True,
            coding=True,
            footer=True,
        ),
    ),
)
nlp.add_pipe(eds.hemiplegia())

Below are a few examples:

text = "Patient hémiplégique"
doc = nlp(text)
spans = doc.spans["hemiplegia"]

spans
# Out: [hémiplégique]
text = "Paralysie des membres inférieurs"
doc = nlp(text)
spans = doc.spans["hemiplegia"]

spans
# Out: [Paralysie des membres]
text = "Patient en LIS"
doc = nlp(text)
spans = doc.spans["hemiplegia"]

spans
# Out: [LIS]

Parameters

PARAMETER DESCRIPTION
nlp

The pipeline

TYPE: Optional[PipelineProtocol]

name

The name of the component

TYPE: Optional[str]

patterns

The patterns to use for matching

DEFAULT: [{'source': 'main', 'regex': ['hemiplegi', 'tet...

label

The label to use for the Span object and the extension

TYPE: str DEFAULT: hemiplegia

span_setter

How to set matches on the doc

TYPE: SpanSetterArg DEFAULT: {'ents': True, 'hemiplegia': True}

Authors and citation

The eds.hemiplegia component was developed by AP-HP's Data Science team with a team of medical experts. A paper describing in details the development of those components is being drafted and will soon be available.