edsnlp.pipes.ner.frailty.sensory_status.factory
create_component = registry.factory.register('eds.sensory_status', assigns=['doc.ents', 'doc.spans'])(SensoryMatcher) module-attribute [source]
The eds.sensory_status pipeline component extracts mentions of the sensory status.
Details of the used patterns
# fmt: off
from ..utils import make_status_assign, normalize_space_characters
healthy = dict(
source="healthy",
regex=[r"acuite (?:visuelle|auditive) normale"],
regex_attr="NORM",
)
severe = dict(
source="severe",
regex=[
r"\bcecite\b",
"aveugle",
"surdite",
],
regex_attr="NORM",
)
altered = dict(
source="altered",
regex=[
r"appareillages? auditifs?",
"lunettes",
r"baisse d'acuite visuelle",
],
regex_attr="NORM",
)
mild = dict(
source="mild",
regex=[
"hypoacousie",
"presbyacousie",
"difficultes? visuelles?",
],
regex_attr="NORM",
)
assourdi = dict(
source="severe_assourdi",
regex=[
r"sourde?",
],
exclude=dict(regex=[r"coeurs?", r"cardiaques?"], window=-3),
regex_attr="NORM",
)
bav = dict(
source="altered_bav",
regex=[r"\bBAV\b"],
exclude=dict(
regex=[
"pacemaker",
"coeur",
r"cardiaques",
"complet",
"nephrologue",
"cardiologue",
"degre",
],
window=(-15, 10),
regex_attr="NORM",
),
regex_attr="ORTH",
)
other = dict(
source="other",
regex=[
r"bilan ophtalmo(?:logique)?",
"avis ophtalmologique",
"examen ophtalmologique",
],
regex_attr="NORM",
)
status = dict(
source="other_status",
regex=[
"statut visuel",
"etat visuel",
"statut auditif",
"etat auditif",
"statut sensoriel",
"etat sensoriel",
],
regex_attr="NORM",
assign=make_status_assign(),
)
default_patterns = normalize_space_characters(
[
other,
healthy,
altered,
mild,
severe,
assourdi,
bav,
status,
]
)
# fmt: on
Extensions
On each span span that match, the following attribute is available:
span._.sensory_status: set to None.
It will specify the severity of the mention regarding the sensory status of the patient.
Possible values are:
healthy: this span suggests the patient is well regarding that domain.altered_nondescript: this span suggests the patient is not well, but it is not yet possible to ascertain the degree of alteration.altered_mild: this span suggests a light alteration regarding this domain.altered_severe: this span suggests a severe alteration regarding this domain.other: this span is not indicative of the level of alteration regarding this domain. Still, it hints that this domain has been evaluated.
Examples
import edsnlp, edsnlp.pipes as eds
nlp = edsnlp.blank("eds")
nlp.add_pipe(eds.sentences())
nlp.add_pipe(eds.normalizer())
nlp.add_pipe(f"eds.sensory_status")
Below are a few examples:
Parameters
| PARAMETER | DESCRIPTION |
|---|---|
nlp | The pipeline TYPE: |
name | The name of the component TYPE: |
patterns | The patterns to use for matching TYPE: |
label | The label to use for the TYPE: |
span_setter | How to set matches on the doc TYPE: |