Skip to content

COPD[source]

The eds.copd pipeline component extracts mentions of COPD (Chronic obstructive pulmonary disease). It will notably match:

  • Mentions of various diseases (see below)
  • Pulmonary hypertension
  • Long-term oxygen therapy
Details of the used patterns
# fmt: off
# fmt: on

Extensions

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

  • span._.detailed_status: set to None

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.copd())

Below are a few examples:

text = "Une fibrose interstitielle diffuse idiopathique"
doc = nlp(text)
spans = doc.spans["copd"]

spans
# Out: [fibrose interstitielle diffuse idiopathique]
text = "Patient atteint de pneumoconiose"
doc = nlp(text)
spans = doc.spans["copd"]

spans
# Out: [pneumoconiose]
text = "Présence d'une HTAP."
doc = nlp(text)
spans = doc.spans["copd"]

spans
# Out: [HTAP]
text = "On voit une hypertension pulmonaire minime"
doc = nlp(text)
spans = doc.spans["copd"]

spans
# Out: []
text = "La patiente a été mis sous oxygénorequérance"
doc = nlp(text)
spans = doc.spans["copd"]

spans
# Out: []
text = "La patiente est sous oxygénorequérance au long cours"
doc = nlp(text)
spans = doc.spans["copd"]

spans
# Out: [oxygénorequérance au long cours]

span = spans[0]

span._.assigned
# Out: {'long': [long cours]}

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': ['alveolites.{1,5}...

label

The label to use for the Span object and the extension

TYPE: str DEFAULT: copd

span_setter

How to set matches on the doc

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

Authors and citation

The eds.copd component was developed by AP-HP's Data Science team with a team of medical experts, following the insights of the algorithm proposed by Petit-Jean et al., 2024.


  1. Petit-Jean T., Gérardin C., Berthelot E., Chatellier G., Frank M., Tannier X., Kempf E. and Bey R., 2024. Collaborative and privacy-enhancing workflows on a clinical data warehouse: an example developing natural language processing pipelines to detect medical conditions. Journal of the American Medical Informatics Association. 31, pp.1280-1290. 10.1093/jamia/ocae069