Skip to content

Dialogue State

Dilyara Baymurzina edited this page Jun 27, 2022 · 5 revisions

Dialogue State in DeepPavlov Dream

Dialogue state is a structured representation of the dialogue. It contains all information about user, bot and dialogue process.

DeepPavlov Agent implies stateless information processing, i.g., all components do not store any information about the particular dialogues in their containers. There is an option to buffer some general knowledge that can be re-used in different dialogues. For example, News API Annotator stores all obtained from API news for some time (optional parameter) having an opportunity to utilize these news in other dialogues and not sending API requests every time.

Dialogue State from High-level

The Dialogue State is represented as a Python distionary. Its high-level structure is represented on the left in the following Image: DeepPavlovDream_0

Basically, the Dialogue State contains dialogue identifier, rating, date start, date finish, utterances list, human and bot profiles. Human and bot profiles are represented as dictionaries with the following keys: identifier, user type, attributes, persona, profile (for user only) and user external identifier (for user only). Structure information about user profile is stored in profile (specific parameters only) and attributes. Human attributes also contains states from scripted skills because the components are stateless, dialogue history is not fully available (usually, we send to skills up to 3-5 last utterances to save time), while the skills need to know where the sub-dialogue were finished, and what was discussed before to not repeat scripts and/or templates. The human attributes structure is shown in the image below: DeepPavlovDream_1

Each human utterance is a dictionary of the following structure: DeepPavlovDream_2 The dictionary contains text, user info, utterance identifier, date time, attributes, hypotheses, and annotations. As shown in the image below human utterance's annotations includes keys which correspond to human utterance's annotators names from pipeline configuration file. Each field contains formatted output of the corresponding annotator. DeepPavlovDream_4

Each human utterance contains hypotheses with response candidates from different skills. Each hypothesis has the following structure: text, confidence assigned by the skill, skill name, annotations, human and bot attributes. If the hypothesis will be selected as a final one, human and bot attributes of the hypothesis will update human and bot attributes in the upper level of the Dialogue State. Similarly to human utterance annotations, hypothesis annotations consists of the outputs from the candidate annotators from the pipeline configuration file. DeepPavlovDream_3

Bot utterances has similar to the human utterances structure except of hypotheses, confidence, original text and active skill fields. They also contain annotations of the bot utterances because a final response can be composed from several hypotheses while their annotations are not merged automatically (except of human and bot attributes). DeepPavlovDream_6