medkit.text.ner.edsnlp_tnm_matcher#

This module needs extra-dependencies not installed as core dependencies of medkit. To install them, use pip install medkit-lib[edsnlp].

Classes:

EDSNLPTNMMatcher([output_label, ...])

TNM (Tumour/Node/Metastasis) string matcher based on EDS-NPL's tnm pipeline <https://aphp.github.io/edsnlp/latest/pipelines/ner/tnm/>.

class EDSNLPTNMMatcher(output_label='TNM', attrs_to_copy=None, uid=None)[source]#

TNM (Tumour/Node/Metastasis) string matcher based on EDS-NPL’s tnm pipeline <https://aphp.github.io/edsnlp/latest/pipelines/ner/tnm/>.

For each TNM string that is found, an entity will be created with an TNMAttribute attribute attached to it containing normalized values of the TNM components.

Parameters
  • output_label (str) – Label to use for TNM entities created (the label of the attributes will always be “TNM”)

  • attrs_to_copy (Optional[List[str]]) – Labels of the attributes that should be copied from the input segment to the created TNM entity. Useful for propagating context attributes (negation, antecedent, etc).

  • uid (str) – Identifier of the matcher

Methods:

run(segments)

Find and return TNM entities for all segments

set_prov_tracer(prov_tracer)

Enable provenance tracing.

Attributes:

description

Contains all the operation init parameters.

run(segments)[source]#

Find and return TNM entities for all segments

Parameters

segments (List[Segment]) – List of segments into which to look for TNM strings

Return type

List[Entity]

Returns

entities (List[Entity]) – TNM entities found in segments, with TNMAttribute attributes

property description: medkit.core.operation_desc.OperationDescription#

Contains all the operation init parameters.

Return type

OperationDescription

set_prov_tracer(prov_tracer)#

Enable provenance tracing.

Parameters

prov_tracer (ProvTracer) – The provenance tracer used to trace the provenance.