medkit.text.ner.duckling_matcher
================================

.. py:module:: medkit.text.ner.duckling_matcher


Classes
-------

.. autoapisummary::

   medkit.text.ner.duckling_matcher.DucklingMatcher


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

.. py:class:: DucklingMatcher(output_label: str, version: str, url: str = 'http://localhost:8000', locale: str = 'fr_FR', dims: list[str] | None = None, attrs_to_copy: list[str] | None = None, uid: str | None = None)

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


   
   Entity annotator using Duckling (https://github.com/facebook/duckling).

   This annotator can parse several types of information in multiple languages:
       amount of money, credit card numbers, distance, duration, email, numeral,
       ordinal, phone number, quantity, temperature, time, url, volume.

   This annotator currently requires a Duckling Server running. The easiest method is
   to run a docker container :

   >>> docker run --rm -d -p <PORT>:8000 --name duckling rasa/duckling:<TAG>

   This command will start a Duckling server listening on port <PORT>.
   The version of the server is identified by <TAG>















   ..
       !! processed by numpydoc !!

   .. py:attribute:: output_label
      :type:  str


   .. py:attribute:: version
      :type:  str


   .. py:attribute:: url
      :type:  str
      :value: 'http://localhost:8000'



   .. py:attribute:: locale
      :type:  str
      :value: 'fr_FR'



   .. py:attribute:: dims
      :type:  list[str] | None
      :value: None



   .. py:attribute:: attrs_to_copy
      :type:  list[str]
      :value: None



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

      
      Return entities for each match in `segments`.


      :Parameters:

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



      :Returns:

          list of Entity
              Entities found in `segments`











      ..
          !! processed by numpydoc !!


   .. py:method:: _find_matches_in_segment(segment: medkit.core.text.Segment) -> Iterator[medkit.core.text.Entity]


   .. py:method:: _test_connection()


