dialoguekit.utils.dialogue_reader

Methods for reading dialogue exports.

Functions

json_to_annotated_utterance(...)

Converts an utterance from JSON format to AnnotatedUtterance.

json_to_dialogues(...)

Parses a JSON file containing dialogues.

Module Contents

dialoguekit.utils.dialogue_reader.json_to_annotated_utterance(json_utterance: Dict[Any, Any]) dialoguekit.core.annotated_utterance.AnnotatedUtterance

Converts an utterance from JSON format to AnnotatedUtterance.

Parameters:

json_utterance

JSON format of an utterance, e.g.,

{
    "participant": "USER",
    "utterance": "hello",
    "intent": "DISCLOSE.NON-DISCLOSE"
}

Returns:

An AnnotatedUtterance object representation of the json utterance.

dialoguekit.utils.dialogue_reader.json_to_dialogues(filepath: str, agent_id: str, user_id: str) List[dialoguekit.core.dialogue.Dialogue]

Parses a JSON file containing dialogues.

Parameters:
  • filepath – Path to JSON file containing the dialogues.

  • agent_id – Agent ID in the dialogues.

  • user_id – User ID in the dialogues.

Returns:

A list of Dialogue objects.