Skip to content

Emergency GEMSA

Matcher for explicit mentions of the French GEMSA emergency score.

Examples

import edsnlp, edsnlp.pipes as eds

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

Parameters

PARAMETER DESCRIPTION
nlp

The pipeline object

TYPE: PipelineProtocol

name

The name of the component

TYPE: str DEFAULT: 'emergency_gemsa'

regex

A list of regexes to identify the score

TYPE: List[str] DEFAULT: regex

attr

Whether to match on the text ('TEXT') or on the normalized text ('NORM')

TYPE: str DEFAULT: 'NORM'

value_extract

Regex with capturing group to get the score value

TYPE: str DEFAULT: value_extract

score_normalization

Function that takes the "raw" value extracted from the value_extract regex and should return:

  • None if no score could be extracted
  • The desired score value otherwise

TYPE: Union[str, Callable[[Union[str, None]], Any]] DEFAULT: score_normalization_str

window

Number of token to include after the score's mention to find the score's value

TYPE: int DEFAULT: 20

ignore_excluded

Whether to ignore excluded spans when matching

TYPE: bool DEFAULT: False

ignore_space_tokens

Whether to ignore space tokens when matching

TYPE: bool DEFAULT: False

flags

Regex flags to use when matching

TYPE: Union[RegexFlag, int] DEFAULT: 0

label

Label name to use for the Span object and the extension

TYPE: str DEFAULT: 'emergency_gemsa'

span_setter

How to set matches on the doc

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

RETURNS DESCRIPTION
SimpleScoreMatcher