# Dialog CIN: Contextual Inference Networks for Emotional Dialogue Generation
###### Abstract  
In recent years, emotional dialogue generation garnered widespread attention and made significant progress in the English-speaking domain. However, research on emotional dialogue generation in Chinese still faces two critical issues: firstly, the lack of high-quality datasets with emotional characteristics makes it difficult for models to fully utilize emotional information for emotional intervention; secondly, there is a lack of effective neural network models for extracting and integrating inherent logical information in the context to fully understand dialogues. To address these issues, this paper presented a Chinese dialogue dataset called LifeDialog, which was annotated with sentiment features. Additionally, it proposed DialogCIN, a contextual inference network that aims to understand dialogues based on a cognitive perspective. Firstly, the proposed model acquired contextual representations at both the global and speaker levels. Secondly, different levels of contextual vectors were separately inputted into the understanding unit, which consists of multiple inference modules. These modules iteratively performed reasoning and retrieval to delve into the inherent logical information of the dialogue context. Subsequently, appropriate emotions were predicted for feedback. Finally, an emotion-aware decoder was employed to generate a response. Experimental results on our manually annotated dataset, LifeDialog, demonstrated that DialogCIN can effectively simulate human cognitive inference processes, enabling a better understanding of dialogue context and improving the quality of generated dialogues. emotional dialogue; response generation; multi-turn dialogues; inference module +
Footnote †: journal: Medical  
tional dialogue generation transitioned towards end-to-end models based on deep learning. [PERSON] et al. [5] advanced the expression of emotions by integrating emotion categories, internal memory networks, and external memory dictionaries. [PERSON] et al. [6] introduced a unified end-to-end neural network architecture capable of encoding both semantics and emotions in a post, thereby generating responses with appropriate emotional expression. To address the generation of emotionally aware responses in dialogues, [PERSON] et al. [7] proposed a multi-resolution interactive model that leveraged emotional information at both the dialogue-level and word-level, incorporating user feedback. [PERSON] et al. [8] developed a heterogeneous graph neural network-based model capable of perceiving emotions from multiple sources of knowledge, including dialogue history, emotion flow, facial expressions, audio, and speaker personality. [PERSON] et al. [9] employed a hierarchical recursive encoder-decoder framework, leveraging two enhanced self-attention encoders to capture semantic and emotional signals independently. Subsequently, these signals were fused in the decoder to generate responses. [PERSON] et al. [10] employed a dual-view conditional variational autoencoder framework, allowing for the separate extraction of emotional information and content-related information from the latent variable distribution of the response. These extracted features were then combined in the decoder to generate emotionally infused responses. Although the aforementioned research achieved impressive results in specific tasks pertaining to the generation of emotional dialogues, it often entailed static learning from dialogue contexts. However, this approach imposes limitations on the exploration of inherent semantic information within the context and constrains the ability to capture more comprehensive contextual cues. As illustrated in Figure 1, Speaker A initially expressed their emotion as \"sadness\", while Speaker B inquired about the reason behind [PERSON]'s sadness, as evident in Utterances u2 and u4. Additionally, Speaker B also conveyed the cause of their own sadness, as reflected in Utterances u5 and u7. At this stage, Speaker B's emotion remains \"sadness\".