medkit.core.audio.document#

Classes:

AudioDocument(audio[, anns, metadata, uid])

Document holding audio annotations.

class AudioDocument(audio, anns=None, metadata=None, uid=None)[source]#

Document holding audio annotations.

Variables
  • uid (str) – Unique identifier of the document.

  • audio – Audio buffer containing the entire signal of the document.

  • anns (AudioAnnotationContainer) – Annotations of the document. Stored in an AudioAnnotationContainer but can be passed as a list at init.

  • metadata (Dict[str, Any]) – Document metadata.

  • raw_segment (Segment) – Auto-generated segment containing the full unprocessed document audio.

Attributes:

RAW_LABEL

Label to be used for raw segment

Methods:

get_subclass_for_data_dict(data_dict)

Return the subclass that corresponds to the class name found in a data dict

RAW_LABEL: ClassVar[str] = 'RAW_AUDIO'#

Label to be used for raw segment

classmethod get_subclass_for_data_dict(data_dict)#

Return the subclass that corresponds to the class name found in a data dict

Parameters

data_dict (Dict[str, Any]) – Data dict returned by the to_dict() method of a subclass (or of the base class itself)

Return type

Optional[Type[Self]]

Returns

subclass – Subclass that generated data_dict, or None if data_dict correspond to the base class itself.