Context-Dependent Embedding Utterance Representations for Emotion Recognition in Conversations (2023)

Abstract: Emotion Recognition in Conversations (ERC) has been gaining increasing importance as conversational agents become more and more common. Recognizing emotions is key for effective communication, being a crucial component in the development of effective and empathetic conversational agents. Knowledge and understanding of the conversational context are extremely valuable for identifying the emotions of the interlocutor. We thus approach Emotion Recognition in Conversations leveraging the conversational context, i.e., taking into attention previous conversational turns. The usual approach to model the conversational context has been to produce context-independent representations of each utterance and subsequently perform contextual modeling of these. Here we propose context-dependent embedding representations of each utterance by leveraging the contextual representational power of pre-trained transformer language models. In our approach, we feed the conversational context appended to the utterance to be classified as input to the RoBERTa encoder, to which we append a simple classification module, thus discarding the need to deal with context after obtaining the embeddings since these constitute already an efficient representation of such context. We also investigate how the number of introduced conversational turns influences our model performance. The effectiveness of our approach is validated on the open-domain DailyDialog dataset and on the task-oriented EmoWOZ dataset.

## introduction emotion recognition in conversations (erc) is useful in automatic opinion mining, emotion-aware conversational agents and assisting modules for therapeutic practices. there is thus an increasing interest in endowing machines with efficient emotion recognition modules. knowledge and understanding of the conversational context, i.e., of the previous conversation turns, are extremely valuable in identifying the emotions of the interlocutors @xcite ) @xcite . research in automatic emotion recognition using machine learning techniques dates back to the end of the 20th century. however, the use of the conversational context as an auxiliary information for the classifiers, did not appear until publicly available conversational datasets became more common. state-of-the-art erc works leverage not only state-of-the-art pre-trained-language models such as bert @xcite and roberta @xcite , but also deep, complex architectures to model several factors that influence the emotions in the conversation @xcite . such fac-1 228 tors usually pertain to self and inter-speaker emotional influence and the context and emotion of preceeding utterances. in this paper we argue that the powerful representation capabilities of pre-trained language models can be leveraged to model context without the need of additional elaborate classifier architectures, allowing for much simpler and efficient architectures. furthermore, it is our contention that the transformer, the backbone of our chosen language model, is better at preserving the contextual information since it has a shorter path of information flow than the rnns typically used for context modelling. in this line, we rely on the roberta language model and resort to a simple classification module to preserve the contextual information. the usual approach to model the conversational context has been to produce context independent representations of each utterance and subsequently perform contextual modeling of those representations. state-of-the art approaches start by resorting to embedding representations from language models and employ gated or graph neural network architectures to perform contextual modelling of these embedding representations at a later step. in our much simpler and efficient proposed approach, we produce context-dependent embedding representations of each utterance, by feeding not only the utterance but also its conversational context to the language model. we thus discard the need to deal with context after obtaining the embeddings since these constitute already an efficient representation of such context. our experiments show that by leveraging context in this way, one can obtain state-of-the-art results with roberta and a simple classification module, surpassing more complex state-of-the-art models. ## related work amongst the first works considering contextual interdependences among utterances is the one by poria et al. @xcite . it uses lstms to extract contextual features from the utterances. these gated recurrent networks make it possible to share information between consecutive utterances while preserving its order. a more elaborate model also leveraging gated recurrent networks is dialoguernn @xcite , which uses grus to model the speaker, context and emotion of preceding utterances by keeping a party state and a global state that are used to model the final emotion representation. gated recurrent networks have a long path of information flow which makes it difficult to capture long term dependencies. these can be better captured with the transformer which a has shorter path of information flow. its invention in 2017 @xcite led to a new state-of-the-art in several natural language processing tasks. amongst the first works leveraging the transformer is the knowledge-enriched transformer (ket) @xcite . it uses its self-attention to model context and response. it also makes use of an external knowledge base, a graph of concepts that is retrieved for each word. following the invention of transformers, pretrained language models brought about another new state-of-the art in 2019. since their invention, most state-of-the art erc works resorted to encoder pre-trained language models @xcite @xcite . cosmic @xcite leverages roberta large as feature extractor. furthermore, it makes use of the commonsense transformer model comet @xcite in order to extract commonsense features. five bi-directional grus model a context state, internal state, external state, intent state, and emotion state that influence the final emotion classification. psychological @xcite also uses roberta large for utterance encoding and comet. for conversation-level encoding it constructs a graph of utterances to model the actions and intentions of the speaker along with the interactions with other utterances. it uses comet to introduce commonsense knowledge into the graph edge representations and processes this graph using a graph transformer network. ## methodology we describe how we obtain a contextual embedding representation of the sentence and its context with roberta, how we pool the contextual embeddings, our classification module and how we obtain the emotion labels. these processes can be observed in figure 2 . ## conclusions and future work in this work we have leveraged context-dependent embedding utterrance representations for emotion recognition in conversations. our approach of producing context-dependent representations of each utterance contrasted with the usual approach of producing context independent representations of each utterance and subsequently performing contextual modeling of these. it consisted in feeding a variable number of previous conversational turns appended to the utterance to be classified as input to the state-of-the-art pre-trained-language model roberta, to which we appended a simple classification module. we further investigated how the number of introduced conversational turns influenced our model performance. we concluded that the introduction of an adequate number of context turns directly as the language model input significantly improves model performance. furthermore, we attained state-of-the-art results on the widely used dailydialog dataset and established a new state-of-the-art by a wide margin on the emowoz dataset, which are usually yielded by 7