dialoguekit.core.annotated_utterance

Interface extending utterances with annotations.

Classes

AnnotatedUtterance

Represents an utterance, with additional annotations.

Module Contents

class dialoguekit.core.annotated_utterance.AnnotatedUtterance(text: str, participant: dialoguekit.participant.participant.DialogueParticipant, timestamp: datetime.datetime | None = None, intent: dialoguekit.core.intent.Intent | None = None, annotations: List[dialoguekit.core.annotation.Annotation] | None = None, metadata: Dict[str, Any] | None = None)

Bases: dialoguekit.core.utterance.Utterance

Represents an utterance, with additional annotations.

The AnnotatedUtterance is a Utterance with additional information. In some cases we want to send an utterance with the Intent and or Annotations.

Parameters:
  • text – Utterance text.

  • participant – The owner of the utterance.

  • timestamp – When the utterance was uttered.

  • intent – The intent of the utterance.

  • annotations – Annotations of the Utterance text.

  • metadata – Dict with optional attributes (satisfaction etc.).

property text: str

Returns the utterance intent.

property intent: dialoguekit.core.intent.Intent

Returns the utterance intent.

property utterance: dialoguekit.core.utterance.Utterance

Returns the annotated utterance as a utterance.

property participant: dialoguekit.participant.participant.DialogueParticipant

Returns the utterance participant.

property metadata: Dict[str, Any]

Returns the utterance metadata.

add_annotation(annotation: dialoguekit.core.annotation.Annotation | List[dialoguekit.core.annotation.Annotation]) None

Adds an annotation to the utterance.

Parameters:

annotation – Annotation instance.

get_annotations() List[dialoguekit.core.annotation.Annotation]

Returns the available annotations for the utterance.

Returns: List of Annotation instances.

set_participant(participant: dialoguekit.participant.participant.DialogueParticipant) None

Sets the utterance participant type.

Parameters:

participant – Participant type who uttered the utterance.

get_text_placeholders() str

Replaces the utterance text with placeholders.

Returns:

The utterance text with annotations replaced with placeholders.