medkit.core.audio.annotation
============================

.. py:module:: medkit.core.audio.annotation


Classes
-------

.. autoapisummary::

   medkit.core.audio.annotation.Segment


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

.. py:class:: Segment(label: str, audio: medkit.core.audio.audio_buffer.AudioBuffer, span: medkit.core.audio.span.Span, attrs: list[medkit.core.attribute.Attribute] | None = None, metadata: dict[str, Any] | None = None, uid: str | None = None)

   Bases: :py:obj:`medkit.core.dict_conv.SubclassMapping`


   
   Audio segment referencing part of an :class:`~.core.audio.AudioDocument`.



   :Attributes:

       **uid: str**
           Unique identifier of the segment.

       **label: str**
           Label of the segment.

       **audio: AudioBuffer**
           The audio signal of the segment. It must be consistent with the span,
           in the sense that it must correspond to the audio signal of the document
           at the span boundaries. But it can be a modified, processed version of this
           audio signal.

       **span: Span**
           Span (in seconds) indicating the part of the document's full signal that
           this segment references.

       **attrs: AttributeContainer**
           Attributes of the segment. Stored in a
           :class:{~medkit.core.AttributeContainer} but can be passed as a list at
           init.

       **metadata: dict of str to Any**
           Metadata of the segment.

       **keys: set of str**
           Pipeline output keys to which the annotation belongs to.













   ..
       !! processed by numpydoc !!

   .. py:attribute:: uid
      :type:  str


   .. py:attribute:: label
      :type:  str


   .. py:attribute:: audio
      :type:  medkit.core.audio.audio_buffer.AudioBuffer


   .. py:attribute:: span
      :type:  medkit.core.audio.span.Span


   .. py:attribute:: attrs
      :type:  medkit.core.attribute_container.AttributeContainer


   .. py:attribute:: metadata
      :type:  dict[str, Any]


   .. py:attribute:: keys
      :type:  set[str]


   .. py:method:: __init_subclass__()
      :classmethod:



   .. py:method:: to_dict() -> dict[str, Any]


   .. py:method:: from_dict(data: dict[str, Any]) -> Segment
      :classmethod:



