Modelling Context Emotions using Multi-task Learning for Emotion Controlled Dialog Generation (2021)

Abstract: A recent topic of research in natural language generation has been the development of automatic response generation modules that can automatically respond to a user’s utterance in an empathetic manner. Previous research has tackled this task using neural generative methods by augmenting emotion classes with the input sequences. However, the outputs by these models may be inconsistent. We employ multi-task learning to predict the emotion label and to generate a viable response for a given utterance using a common encoder with multiple decoders. Our proposed encoder-decoder model consists of a self-attention based encoder and a decoder with dot product attention mechanism to generate response with a specified emotion. We use the focal loss to handle imbalanced data distribution, and utilize the consistency loss to allow coherent decoding by the decoders. Human evaluation reveals that our model produces more emotionally pertinent responses. In addition, our model outperforms multiple strong baselines on automatic evaluation measures such as F1 and BLEU scores, thus resulting in more fluent and adequate responses.

## introduction one of the key skills for dialogue agents in a dialog system is to acknowledge the feelings of the user and respond accordingly. it is quite instinctive for humans to identify and understand other people's emotions but is quite hard for artificial intelligence (ai) systems due to the lack of representative publicly available data sets for training and evaluating an intelligent and robust dialog management system. ## related work early representative works were mostly based on the manually hand-crafted rules @xcite , for generating responses with a specific emotion. although rule-based approaches show high accuracy they often fail to handle complex emotions, especially for large corpora. in @xcite , computational experiments established that empathetic agents ensure good communication. @xcite designed an empathetic virtual agent that can express emotions based on cognitive appraisal theories which require an extensive hand-crafted rule base. in recent years, there is an emerging research trend in an end-to-end neural network based generative conversational systems @xcite . to improve the content quality of neural conversational models, many techniques have been proposed, such as improving response diversity using conditional variational autoencoders (cvae) @xcite and encoding commonsense knowledge using external facts corpus @xcite . by expressing emotions, people show their mutual respect, empathy and understanding to each other, and thus improve the relationship between them. emotional chatting machine (ecm) @xcite extended the basic encoder-decoder architecture using three mechanisms, viz. emotion category embedding, internal emotion memory, and external memory in order to generate sequence with a particular emotion label. affect transfer in text using recurrent neural networks (rnns) @xcite and text generation using emojis as the target labels ( zhou and wang, 2017 various techniques that can capture user's emotional state empathetic response generation were developed in @xcite . an affective attention based model coupled with weighted cross-entropy loss was proposed by @xcite for affective dialogue generation. @xcite built an empathetic chatbot which fine-tunes a generative pre-trained transformer (gpt) with multiple objectives: response language modeling, response prediction, and dialogue emotion detection. multi-task learning, with deep neural networks which learn from different related-tasks has achieved remarkable success in improving the performance of many natural language processing (nlp) tasks @xcite @xcite . a multi-task learning framework usually consists of an encoder which is shared across multiple tasks to learn a common set of shared features. moreover, the encoder learns to focus more on important and desirable features, and ignores redundant and noisy features @xcite . @xcite proposed a new dataset with ∼ 25k conversations empathetic dialogue generation. the conversations in the dataset are prepared for a given emotion label. as opposed to this, our model handles dataset which has different emotion labels for every utterance in a dialog. as per our knowledge there is no existing work that has proposed the multi-task learning architecture for heterogeneous emotions in a conversation. in our current work, we propose a multi-task framework with a shared multi-head self-attention based hierarchical encoder for response generation and emotion classification. we also utilize focal loss for emotion classification. additionally, we incorporate a consistency based loss to enable persistent output generation for our multi-task architecture. the experiments are performed on the knowledge and emotion grounded topical chat dataset @xcite containing a significant amount of human-human conversations in open-domain setting. our approach tends to produce adequate responses. ## results and analysis we present the results for all our experiments in this section. detailed results using both the automatic and human evaluation methods are shown in ## conclusion and future work in this paper, we have proposed a new deep learning framework for modeling emotion-grounded conversations using emotion labels as the guiding attributes. building an emotion-aware conversational agent is crucial in enhancing the user interactions with long, engaging conversations. extensive experiments show that the predicted responses expressed high levels of emotional accuracy and content adequacy. we have also provided details of different kinds of errors found in section 5.3. in general, we show how a related task of emotion recognition along with appropriate loss functions can ensure emotional relevancy of the generated response and improves user engagement. in the future, we intend to use pre-trained language models for the task of dialog generation using emotion labels. we also aim to extend our model to handle knowledge-grounded conversations.