H i T rans: A Transformer-Based Context- and Speaker-Sensitive Model for Emotion Detection in Conversations (2020)

Abstract: Emotion detection in conversations (EDC) is to detect the emotion for each utterance in conversations that have multiple speakers. Different from the traditional non-conversational emotion detection, the model for EDC should be context-sensitive (e.g., understanding the whole conversation rather than one utterance) and speaker-sensitive (e.g., understanding which utterance belongs to which speaker). In this paper, we propose a transformer-based context- and speaker-sensitive model for EDC, namely HiTrans, which consists of two hierarchical transformers. We utilize BERT as the low-level transformer to generate local utterance representations, and feed them into another high-level transformer so that utterance representations could be sensitive to the global context of the conversation. Moreover, we exploit an auxiliary task to make our model speaker-sensitive, called pairwise utterance speaker verification (PUSV), which aims to classify whether two utterances belong to the same speaker. We evaluate our model on three benchmark datasets, namely EmoryNLP, MELD and IEMOCAP. Results show that our model outperforms previous state-of-the-art models.

## related work emotion detection has received increasing attention in recent years. nlp researchers has organized a number of competitions and published several datasets for emotion detection from different granularities of text such as documents @xcite , sentences @xcite and short text @xcite . besides traditional emotion detection from the static text, conversational emotion detection has also become a research hotspot and many publicly available datasets have been released @xcite . different from traditional emotion detection, there are two characteristics that play important roles in conversational emotion detection. first of all, the context information of the conversation is crucial since speaker's emotions may change during the conversation. second, the emotions of utterances may be influenced by speakers' personalities sometimes. in the following, we will give an overview of the methods for edc in previous work. in early studies, emotion detection in textual conversations is often addressed via feature engineering such as lexicon and acoustic features @xcite . as deep learning develops, recent studies begin to treat the edc task as a sequence labeling problem @xcite and leverage deep recurrent neural networks (rnns) to handle it @xcite @xcite . sequence-based approaches are able to effectively capture contextual utterance information and long-distance dependency in conversations. our work also follows this line of work, but employs a more advanced model, namely the transformer @xcite . to our knowledge, there is only one prior work that uses the transformer for edc @xcite . they focus on knowledge enrichment for the transformer, while we focus on building a context-and speaker-sensitive transformer. another line of prior work paid attention to integrate speaker information into the model for edc, as speaker information is able to affect edc in a considerable extent @xcite . @xcite propose an rnn-based edc model to track both local and global state dynamically. in addition, graph-based approaches have also been employed for edc, since they are capable of modeling context-and speaker-sensitivity @xcite . for example, @xcite build a conversational graph, where the nodes represent utterances or speakers and the edges represent the dependencies between the speakers and utterances. then they leveraged a graph convolutional network @xcite to propagate context and speaker information among the utterances. in this work, we explore speaker information for edc in an alternative way, proposing an auxiliary task to utilize speaker information and improving our model by multi-task learning @xcite . ## approach first of all, we define the edc task as below: given a conversation with n consecutive utterances {u 1 , u 2 , • • • , u n } and m speakers {s 1 , s 2 , • • • , s m }, the objective of the edc task is to predict the emotion label for each utterance, such as joy and sadness. each utterance u i is uttered by one speaker s j . the high-level architecture of our model hitrans is shown in figure 2 , which stacks a high-level transformer on a low-level transformer. the low-level transformer generates local utterance representations (section 3.1) and the high-level one further embeds global context information into utterance representations (section 3.2). on top of the model, a biaffine classifier performs pairwise utterance speaker verification (section 3.4) as an auxiliary task to facilitate an mlp to do emotion detection (section 3.3). we will introduce the details of each part in the following sections. ## conclusion in this work, we propose a transformer-based context-and speaker-sensitive model for emotion detection in conversations. we evaluate our model on three benchmark datasets and demonstrate its effectiveness compared with previous state-of-the-art models. through experiments and analyses, we find that our model is able to effectively capture the whole context information of conversations and the speaker information. the multi-task learning between the edc and pusv tasks indeed helps our model to improve the performance. in the future, we will explore how to integrate our model with graph-based models to better emotion detection in conversations.