Skip to content

Suicide Attempt[source]

The eds.suicide_attempt pipeline component detects mentions of Suicide Attempt. It can be used with a span qualifier for contextualisation of the entity (history) and to detect false positives as negation, hypothesis or family. We recommend to use a machine learning qualifier to disambiguate polysemic words, as proposed in Bey et al., 2024.

Every matched entity will be labelled suicide_attempt.

Extensions

Each entity span will have the suicide attempt modality as an attribute. The available modalities are:

  • suicide_attempt_unspecific
  • autolysis
  • intentional_drug_overdose
  • jumping_from_height
  • cuts
  • strangling
  • self_destructive_behavior
  • burn_gas_caustic

Examples

import edsnlp, edsnlp.pipes as eds

nlp = edsnlp.blank("eds")
nlp.add_pipe(eds.suicide_attempt())

text = "J'ai vu le patient à cause d'une IMV avec paracetamol"
doc = nlp(text)
doc.ents
# Out: (IMV,)

ent = doc.ents[0]
ent._.suicide_attempt_modality
# Out: 'intentional_drug_overdose'
Patterns used for the named entity recognition
# fmt: off
patterns = {
    "suicide_attempt_unspecific": [
        r"\b(?<!\.)(?<!Voie\s\d\s\:\s)(?<!Voie\sd.abord\s\:\s)(?<!surface\s)(?<!d[ée]sorientation\s)(?<!abord\s)(?<!ECG\s:\s)(?<!volume\s)(?<!\d\s[mc]m\sde\sla\s)(?<!\d[mc]m\sde\sla\s)(?<!au\scontact\sde\sla\s)T\.?S\.?(?![\.A-Za-z])(?!\sapyr[eé]tique)(?!.+TRANSSEPTAL)(?!.+T[34])(?!.+en\sr.gression)\b",
        r"(?<!\.)T\.S\.(?![A-Za-z])",
        r"\b(?<!.)TS\.\B",
        r"(?i)tentative[s]?\s+de\s+sui?cide",
        r"(?i)tent[ée]\s+de\s+((se\s+(suicider|tuer))|(mettre\s+fin\s+[àa]\s+((ses\s+jours?)|(sa\s+vie))))",
    ],
    "autolysis": [r"(?i)tentative\s+d'autolyse", r"(?i)autolyse"],
    "intentional_drug_overdose": [
        r"(?i)(intoxication|ingestion)\s+m[ée]dicamenteuse\s+volontaire",
        r"(?i)\b(i\.?m\.?v\.?)\b",
        r"(?i)(intoxication|ingestion)\s*([a-zA-Z0-9_éàèôê\-]+\s*){0,3}\s*volontaire",
        r"TS\s+med\s+polymedicamenteuse",
        r"TS\s+(poly)?([\s-])?m[ée]dicamenteuse",
    ],
    "jumping_from_height": [
        r"(?i)tentative[s]?\s+de\s+d[ée]fenestration",
        r"(?i)(?<!id[ée]es?\sde\s)d[ée]fenestration(?!\saccidentelle)",
        r"(?i)d[ée]fenestration\s+volontaire",
        r"(?i)d[ée]fenestration\s+intentionnelle",
        r"(?i)jet.r?\sd.un\spont",
    ],
    "cuts": [r"(?i)phl[ée]botomie"],
    "strangling": [r"(?i)pendaison"],
    "self_destructive_behavior": [r"(?i)autodestruction"],
    "burn_gas_caustic": [r"(?i)ing[eé]stion\sde\s(produit\s)?caustique"],
}
# fmt: on

Parameters

PARAMETER DESCRIPTION
nlp

The pipeline object.

TYPE: PipelineProtocol

name

The name of the pipe

TYPE: str DEFAULT: 'eds.suicide_attempt'

attr

Attribute to match on, eg TEXT, NORM, etc.

TYPE: Union[str, Dict[str, str]] DEFAULT: 'TEXT'

ignore_excluded

Whether to skip excluded tokens during matching.

TYPE: bool DEFAULT: False

ignore_space_tokens

Whether to skip space tokens during matching.

TYPE: bool DEFAULT: False

patterns

The regex pattern to use

TYPE: List[str]

span_setter

How to set matches on the doc

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

label

Label name to use for the Span object and the extension

TYPE: str DEFAULT: 'suicide_attempt'

RETURNS DESCRIPTION
SuicideAttemptMatcher

Authors and citation

The eds.suicide_attempt component was developed by AP-HP's Data Science team, following the insights of the algorithm proposed by Bey et al., 2024.


  1. Bey R., Cohen A., Trebossen V., Dura B., Geoffroy P., Jean C., Landman B., Petit-Jean T., Chatellier G., Sallah K., Tannier X., Bourmaud A. and Delorme R., 2024. Natural language processing of multi-hospital electronic health records for public health surveillance of suicidality. 10.1038/s44184-023-00046-7