:py:mod:`medkit.text.ner.edsnlp_tnm_matcher`
============================================

.. py:module:: medkit.text.ner.edsnlp_tnm_matcher


Module Contents
---------------

Classes
~~~~~~~

.. autoapisummary::

   medkit.text.ner.edsnlp_tnm_matcher.EDSNLPTNMMatcher




.. py:class:: EDSNLPTNMMatcher(output_label: str = 'TNM', attrs_to_copy: list[str] | None = None, uid: str | None = None)


   Bases: :py:obj:`medkit.core.text.operation.NEROperation`

   
   TNM (Tumour/Node/Metastasis) string matcher based on the `EDS-NLP TNM`_ pipeline.

   For each TNM string that is found, an entity will be created with an
   :class:`~medkit.text.ner.TNMAttribute` attribute attached to it containing
   normalized values of the TNM components.

   .. _EDS-NLP TNM: https://aphp.github.io/edsnlp/latest/pipelines/ner/tnm/

   :Parameters:

       **output_label** : str, default="TNM"
           Label to use for TNM entities created (the label of the
           attributes will always be "TNM")

       **attrs_to_copy** : list of str, optional
           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, optional
           Identifier of the matcher














   ..
       !! processed by numpydoc !!
   .. py:method:: run(segments: list[medkit.core.text.Segment]) -> list[medkit.core.text.Entity]

      
      Find and return TNM entities for all `segments`.


      :Parameters:

          **segments** : list of Segment
              List of segments into which to look for TNM strings

      :Returns:

          list of Entity
              TNM entities found in `segments`, with
              :class:`~medkit.text.ner.TNMAttribute` attributes













      ..
          !! processed by numpydoc !!

   .. py:method:: _find_tnms_in_segment(segment, spacy_doc) -> Iterator[medkit.core.text.Entity]



