A Unified Framework for Emotion Identification and Generation in Dialogues (2023)

Abstract: Social chatbots have gained immense popularity, and their appeal lies not just in their capacity to respond to the diverse requests from users, but also in the ability to develop an emotional connection with users. To further develop and promote social chatbots, we need to concentrate on increasing user interaction and take into account both the intellectual and emotional quotient in the conversational agents. In this paper, we propose a multi-task framework that jointly identifies the emotion of a given dialogue and generates response in accordance to the identified emotion. We employ a {BERT} based network for creating an empathetic system and use a mixed objective function that trains the end-to-end network with both the classification and generation loss. Experimental results show that our proposed framework outperforms current state-of-the-art models.

## introduction one of the significant challenges of artificial intelligence (ai) is to endow the machine with the ability to interact in natural language with humans. the personal assistants in our mobile devices invariably assist in our day-to-day lives by answering a wide range of queries. such assistants act as social agents that take care of the various activities of their users. besides reacting passively to user requests, they also proactively anticipate user needs and provide in-time assistance, such as reminding of an upcoming event or suggesting a useful service without receiving explicit user requests @xcite . the daunting task for these agents is that they have to work well in open domain scenarios as people learn to rely on them to effectively maintain their works and lives efficiently. building social chatbots to tackle the emotional needs is indeed of great benefit to our society. the primary objective of these chatbots is not inherently to answer all the users' questions, but rather to be a virtual companion of the users. therefore, it is essential to empower the conversational agents with the ability to perceive and express emotions to make them capable of interacting with the user at the human level. these agents help enhance user satisfaction @xcite , while reducing the breakdowns in conversations @xcite and providing user retention. hence, dialogue systems capable of generating replies while considering the user's emotional state is the most desirable advancement in artificial intelligence (ai). previously, researchers have focused upon classifying user emotions @xcite in conversations. for building an intelligent agent, sheer understanding of emotions is insufficient; hence several works @xcite have concentrated in inducing emotions into the dialogue system. most of these existing research have focused on generating emotionally aware @xcite or emotionally controlled responses @xcite . in our current work, we focus on creating an endto-end emotional response generation system that is capable of identifying the emotions and use the emotional information simultaneously for generating empathetic and emotionally coherent responses. the key contributions of our current work are threefold: (i) we propose a joint model that is able to simultaneously identify the emotions from the utterances and incorporate the emotional information for generation; (ii) we design a multi-task hierarchical framework with a mixed objective function that jointly optimize the classification and generation loss; (iii) experimental analysis shows that the proposed multi-task framework is better in generating empathetic responses as opposed to single task emotion generation networks. ## related work in @xcite , the authors proposed a novel large-scale emotional dialogue dataset, consisting of 1m dialogues and annotated with 32 emotions and 9 empathetic response intents using a bert-based fine-grained dialogue emotion classifier. most of the early research on emotion classification was performed upon textual datasets mostly taken from twitter @xcite . the authors in @xcite , propose a multi-party conversational dataset for emotions. lately, emotional text generation has gained immense popularity @xcite @xcite @xcite . in @xcite , an emotional chatting machine (ecm) was built based on seq2seq framework for generating emotional responses. recently, a lexicon-based attention framework was employed to generate responses with a specific emotion @xcite . emotional embedding, affective sampling and regularizer were employed to generate the affect driven dialogues in @xcite . the authors employed curriculum dual learning @xcite for emotion controllable response generation. in @xcite @xcite , the authors proposed an end-to-end neural framework that captures the emotional state of the user for generating empathetic responses. our present research differs from these as we propose and address a novel task of generating responses and simultaneously identifying the emotions in a multi-task framework. ## problem definition in this paper, we address the problem of identifying emotion from a user utterance and generate empathetic responses accordingly. in this setting, emotion remains the same throughout the conversation. let u @xmath0,1 , u p,2 , ..., u p,j be the set of utterances in a conversation and e p denotes the emotion for the conversation. we aim to identify e p through our emotion classification sub-network and use this emotion information to generate responses to the user utterances u p . understanding emotion initially is very crucial to empathetic response generation and cannot be treated independently. hence, we aim to propose an end-to-end model capable to identifying emotions and utilizes this emotion information for generation. 4 proposed model in this section, we present the proposed model. it has two sub-networks: emotion classification subnetwork and generation sub-network. ## baseline methods and metrics we compare our model to the below sota models. pretrained: it is a transformer model trained on 1.7 billion reddit conversations @xcite . fine-tuned: the above pre-trained model is fine-tuned on emotion dialogue dataset @xcite .