medkit.core.audio.annotation#

Classes#

Segment

Audio segment referencing part of an AudioDocument.

Module Contents#

class medkit.core.audio.annotation.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: medkit.core.dict_conv.SubclassMapping

Audio segment referencing part of an 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.

uid: str#
label: str#
audio: medkit.core.audio.audio_buffer.AudioBuffer#
span: medkit.core.audio.span.Span#
attrs: medkit.core.attribute_container.AttributeContainer#
metadata: dict[str, Any]#
keys: set[str]#
classmethod __init_subclass__()#
to_dict() dict[str, Any]#
classmethod from_dict(data: dict[str, Any]) Segment#