medkit.text.spacy.pipeline
==========================

.. py:module:: medkit.text.spacy.pipeline


Classes
-------

.. autoapisummary::

   medkit.text.spacy.pipeline.SpacyPipeline


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

.. py:class:: SpacyPipeline(nlp: spacy.Language, spacy_entities: list[str] | None = None, spacy_span_groups: list[str] | None = None, spacy_attrs: list[str] | None = None, medkit_attribute_factories: dict[str, Callable[[spacy.tokens.Span, str], medkit.core.Attribute]] | None = None, name: str | None = None, uid: str | None = None)

   Bases: :py:obj:`medkit.core.operation.Operation`


   
   Segment annotator relying on a Spacy pipeline.
















   ..
       !! processed by numpydoc !!

   .. py:method:: run(segments: list[medkit.core.text.Segment]) -> list[medkit.core.text.Segment]

      
      Run the operation.

      Run a spacy pipeline on a list of segments provided as input
      and returns a new list of segments.
      Each segment is converted to spacy document (Doc object).
      Then, the spacy pipeline is executed and finally, the new
      annotations and attributes are converted into medkit annotations.

      :Parameters:

          **segments** : list of Segment
              List of segments on which to run the spacy pipeline

      :Returns:

          list of Segment
              List of new annotations













      ..
          !! processed by numpydoc !!


   .. py:method:: _find_segments_in_spacy_doc(spacy_doc: spacy.tokens.Doc, medkit_source_ann: medkit.core.text.Segment)


