Skip to content

edsnlp.pipes.ner.frailty.scores.base

FrailtyScoreMatcher [source]

Bases: ContextualMatcher

Matcher component to extract scores related to frailty evaluation.

Works similarly to eds.scores, with a few differences : - its patterns argument allows for 'limit' assigns, which help restrain the context windows for the other 'regular' assigns. This is mainly useful when two scores are often put close to one another, and we don't want the context window of one to overlap on the other. - it has a domain argument, which is used to store the severity of the span, given the value found for this score. As an example, adl_score 3/4 would set span._.functional_status to 'altered_nondescript'.

assign_one [source]

Functions similarly to ContextualMatcher assign_one, but with added feature of "limit" assigns. Assigns with the keyword "limit" in their name will function as "limit" assigns : they they reduce the context window of all other assigns if they match something. This is mainly useful for the frailty scores, which can have the whole detail of their sub-items listed with the overall score at the end, thus needing a large context window to capture the score, but are also often right next to another frailty score, meaning a "naive" large window risks confusing the scores of several different clinical scores. Limit assigns help to alleviate that issue, by giving a large context window to find the overall score while allowing to restrain this window if another score name is found in this window.

Get additional information in the context of each entity. This function will populate two custom attributes:

  • ent._.source
  • ent._.assigned, a dictionary with all retrieved information

Parameters

PARAMETER DESCRIPTION
span

Span to enrich

TYPE: Span

RETURNS DESCRIPTION
List[Span]

Spans with additional information