Context or Knowledge is Not Always Necessary: A Contrastive Learning Framework for Emotion Recognition in Conversations (2023)

Abstract: Emotion recognition in conversations (ERC) aims to detect the emotion of utterances in conversations. Existing efforts generally focus on modeling context- and knowledge-sensitive dependencies. However, it is observed that the emotions of many utterances can be correctly detected without context or external knowledge. In such cases, blindly leveraging the context and external knowledge may impede model training. Based on this, we propose a novel framework based on contrastive learning (CL), called CKCL (including the contrastive learning scenarios among Context and Knowledge), to distinguish the above utterances for better vector representations. The CKCL framework defines context- and knowledge-independent utterances, as the positive sample, whose predicted results are unchanged even masking context and knowledge representations, otherwise, the negative sample. This can obtain a latent feature reflecting the impact degree of context and external knowledge on predicted results, thus effectively denoising irrelevant context and knowledge during training. Experimental results on four datasets show the performance of CKCL-based models is significantly boosted and outperforms state-of-the-art methods.

## introduction emotion recognition in conversations (erc) has received an active research attention @xcite @xcite @xcite because of its wide applications in many fields such as opinion mining @xcite and recommender systems @xcite . existing works in erc conventionally need to model context-sensitive dependencies @xcite and knowledge-sensitive dependencies @xcite @xcite . especially, in knowledge-sensitive erc models, there are mainly two kinds of external knowledge: one is concepts retrieved from external knowledge bases conceptnet @xcite or sentic-net @xcite . the other is generated by the pre-training commonsense transformers (comet) @xcite . additionally, in context-sensitive erc models, recent studies proposed various methods, including memory networks @xcite @xcite and graph-based models @xcite @xcite . however, these works do not follow whether models need context and external knowledge for the current utterance, but rather on improving modeling methods. in fig. 1 , intuitively, the emotion of example 1 can be recognized even without leveraging context and external knowledge. example 2 (context-independent) is the first utterance in a conversation, lacking any context. without establishing a relationship between patio furniture and 'joyful', it becomes challenging to detect emotions. for example 3 (knowledge-independent), the literal meaning of the utterance is opposite to the conveyed emotion. so, it is difficult to correctly detect the emotion of the utterance without context. although the above example exists, the removal of context or external knowledge will lead to a semantic gap between utterances representations. therefore, how to differentiate context-and knowledge-independent utterances from other utterances is a challenge. based on the above, we proposed a framework based on contrastive learning (cl), ckcl, to distinguish context-and knowledge-independent utterances during training. concretely, the context-independent and knowledge-independent (or context-dependent and knowledge-dependent) utterances are labeled as '1' (or labeled '0'). then, the ckcl pulls utterances with the same or different labels together or further apart. for erc models, this can alleviate the performance degradation of context-and knowledge-independent utterance representations during training. and the ckcl can also denoise irrelevant context and knowledge to improve the robustness ability of models. in addition, inspired by @xcite , we introduce a weighted supervised cl (scl) named emotion scl into ckcl, to further distinguish similar emotions, which takes into account the uneven distribution of classes in erc. to summarize, our main contributions can be summarized as follows: ## related work emotion recognition in conversations context-sensitive models the emotion generation theory @xcite indicates the importance of contextual information for emotion identification. rnn-based models @xcite are often used to model context dependencies. however, they are unable to capture the distinction between historical utterances @xcite when modeling context. to solve this problem, most works began to focus on the memory network @xcite . in addition, the role of participants in erc is also important to the speaker's emotional state @xcite . to model the speaker-level context, researchers have a greater emphasis on speakerspecific models @xcite , graphbased models @xcite , and so on. knowledge-sensitive models although the above works have achieved respectable performance in erc, they are not able to work like a human because of the lack of commonsense knowledge @xcite . therefore, @xcite utilized grus and generated knowledge from comet, to model the psychological states of participants in conversations. @xcite introduce the psychological-knowledgeaware interaction graph (skaig) model to further model the structural psychological states. @xcite proposed a graph-based model to model the knowledge-sensitive dependencies by incorporating concepts retrieved from conceptnet @xcite . subsequently, @xcite proposed a causal aware model using generated knowledge to capture the context information. however, these methods, both context-and knowledgesensitive models, have performance degradation, that is, their performance in some utterances is even worse than models without context and knowledge. chen et al. (2020 ) proposed a classic comparative learning network simclr, which uses various image augmentation strategies to produce positive and negative samples from the same image for visual representation. in the field of nlp, motivated by the poor performance of bert in semantic text similarity tasks, yan et al. (2021) proposed a selfsupervised cl for fine-tuning bert. additionally, kim et al. (2021) explore a cl method without data augmentation, which employs bert with frozen and fine-tunable parameters to produce positive and negative samples. then, gao et al. (2021) positive neutral negative mask pseudo labeling figure 2: the proposed ckcl framework. the dotted line represents data flows without backpropagation. ce denotes cross-entropy, which is widely adopted in erc. employed dropout to augment data. to effectively use label information, gunel et al. (2020) extended the self-supervised cl to a fully-supervised cl setting, which pulls the samples with the same or different labels together or away, respectively, which also boosts the performance of the model in few-shot learning scenarios. in erc, li et al. (2022a) tried to employ the supervised cl (scl) to pull utterances with different emotions further away to better identify similar emotions. unfortunately, there is no related work based on unsupervised cl in erc. ## conclusion in this paper, we propose a novel ckcl framework to enhance utterance representations in erc. more concretely, we employ context (or knowledge) cl to capture the correlation and difference between context-independent and context-dependent (or knowledge-independent and knowledge-dependent) utterances representations, which also enhances the ability of models to denoising irrelevant context or knowledge. additionally, the emotion scl can pull utterances with different labels further apart, and then obtain clearer differences in utterances with similar emotions. experimental results show that our ckcl framework significantly boosted various erc models and outperformed state-of-the-art methods.