Skip to content

TNM

The eds.tnm component extracts TNM mentions from clinical documents.

Examples

import edsnlp, edsnlp.pipes as eds

nlp = edsnlp.blank("eds")
nlp.add_pipe(eds.sentences())
nlp.add_pipe(eds.tnm())

text = "TNM: pTx N1 M1"

doc = nlp(text)
doc.ents
# Out: (pTx N1 M1,)

ent = doc.ents[0]
ent._.tnm.dict()
# {'modifier': 'p',
#  'tumour': None,
#  'tumour_specification': 'x',
#  'node': '1',
#  'node_specification': None,
#  'metastasis': '1',
#  'resection_completeness': None,
#  'version': None,
#  'version_year': None}

Parameters

PARAMETER DESCRIPTION
nlp

The pipeline object

TYPE: Optional[PipelineProtocol]

name

The name of the pipe

TYPE: str

pattern

The regex pattern to use for matching ADICAP codes

TYPE: Optional[Union[List[str], str]] DEFAULT: (?:\b|^)(?<=\(?(?P<version>uicc|accj|tnm|UICC|A...

attr

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

TYPE: str DEFAULT: TEXT

label

Label name to use for the Span object and the extension

TYPE: str DEFAULT: tnm

span_setter

How to set matches on the doc

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

Authors and citation

The TNM score is based on the development of S. Priou, B. Rance and E. Kempf (Kempf et al., 2022).


  1. Kempf E., Priou S., Lamé G., Daniel C., Bellamine A., Sommacale D., Belkacemi y., Bey R., Galula G., Taright N., Tannier X., Rance B., Flicoteaux R., Hemery F., Audureau E., Chatellier G. and Tournigand C., 2022. Impact of two waves of Sars-Cov2 outbreak on the number, clinical presentation, care trajectories and survival of patients newly referred for a colorectal cancer: A French multicentric cohort study from a large group of University hospitals. {International Journal of Cancer}. 150, pp.1609-1618. 10.1002/ijc.33928