Source-linked AI summary

Topic-Driven and Knowledge-Aware Transformer for Dialogue Emotion Detection

Lixing Zhu, Gabriele Pergola, Lin Gui, Deyu Zhou, Yulan He

arXiv:2106.01071v1cs.CL

TL;DR

Dialogue emotion detection requires modeling contextual semantics, conversational topics, commonsense knowledge, and transitions between affective states. The paper combines a topic-augmented language model, retrieved or generated commonsense knowledge, and a Transformer Encoder-Decoder for emotion-sequence prediction. Across four datasets, the proposed model shows empirical effectiveness, while its evaluation predicts labels autoregressively without access to subsequent utterances.

  • Problem

    Dialogue emotion detection remains difficult because emotion depends on conversational topics, context, and implicit commonsense knowledge.

  • Method

    The model fine-tunes a topic-augmented language model, integrates ATOMIC commonsense knowledge with pointer and attention mechanisms, and predicts emotion-label sequences using a Transformer Encoder-Decoder.

  • Results

    The model outperforms COSMIC on weighted Avg-F1 for MELD and EmoryNLP, improves over COSMIC on DailyDialog Macro-F1, and shows topic–emotion clustering correlations of 0.60, 0.58, 0.42, and 0.54 across four datasets.

  • Takeaways & Limitations

    Topic representation learning and commonsense knowledge integration both contribute to dialogue emotion detection performance.

  • Takeaways & Limitations

    At each predictive step, subsequent utterances are unseen, so training assumes autoregressive prediction from available dialogue context.

Abstract

from arXiv · show

Emotion detection in dialogues is challenging as it often requires the identification of thematic topics underlying a conversation, the relevant commonsense knowledge, and the intricate transition patterns between the affective states. In this paper, we propose a Topic-Driven Knowledge-Aware Transformer to handle the challenges above. We firstly design a topic-augmented language model (LM) with an additional layer specialized for topic detection. The topic-augmented LM is then combined with commonsense statements derived from a knowledge base based on the dialogue contextual information. Finally, a transformer-based encoder-decoder architecture fuses the topical and commonsense information, and performs the emotion label sequence prediction. The model has been experimented on four datasets in dialogue emotion detection, demonstrating its superiority empirically over the existing state-of-the-art approaches. Quantitative and qualitative results show that the model can discover topics which help in distinguishing emotion categories.

1 Introduction

Dialogue emotion detection must account for contextual semantics, conversational topics, and shared commonsense knowledge because similar utterances can express different emotions. The paper proposes a topic-driven, knowledge-aware Transformer that combines topic modeling, commonsense integration, and autoregressive emotion-sequence prediction.

  • Motivation: Emotion detection is challenging because an utterance’s emotion can depend on personal expectations and the surrounding dialogue context.The sentence “I just passed the exam” may express happiness or sadness depending on the subject’s expectation.
  • Motivation: Conversational topics influence utterance meaning and the emotions conveyed by particular expressions.The same utterance can express different emotions depending on its associated topic, while food- and restaurant-related utterances are more likely to carry positive sentiment.
  • Research gap: Existing methods were limited because they did not emphasize holistic dialogue properties such as conversational topics, tones, and shared commonsense knowledge.The paper identifies commonsense knowledge as important for both emotion and topic detection.
  • Approach: The proposed model adds a topic layer to a pretrained language model, uses attention and gating to incorporate retrieved commonsense knowledge, and predicts emotion labels with a Transformer Encoder-Decoder.The model predicts an emotion label sequence from an utterance sequence while using historical dialogue context.
  • Contributions: The paper presents topic-driven fine-tuning, pointer-network and additive-attention knowledge integration, and a Transformer Encoder-Decoder as its main contributions.These components target low-resource topic discovery, multi-source commonsense integration, and dialogue emotion-sequence prediction.

2 Related Work

Prior work models dialogue context, thematic representations, and commonsense knowledge through recurrent, graph-based, variational, pretrained-language-model, and knowledge-retrieval approaches. However, several existing approaches require substantial training or pretrained embeddings and are not directly suited to low-resource dialogue emotion detection.

  • Dialogue Emotion Detection: Dialogue emotion detection research has modeled context with GRUs, hierarchical recurrent networks, and graph convolutional networks.These approaches capture global context, token- and utterance-level structure, or emotional dependencies involving context and speakers.
  • Latent Variable Models for Dialogue Context Modelling: Latent variable models such as VAEs have been used to learn thematic representations and model dynamically evolving conversation characteristics.Related work applies variational approaches to dialogue generation and thematic modeling.
  • Latent Variable Models for Dialogue Context Modelling: Some VAE-based dialogue models use pretrained language models as embedding inputs, but they cannot be directly applied to low-resource dialogue emotion detection.These models must be trained from scratch or built upon pretrained embeddings.
  • Knowledge Base and Knowledge Retrieval: Commonsense resources include ConceptNet and ATOMIC, while pretrained language models can also encode relational knowledge from large-scale text corpora.COMET generates commonsense descriptions in natural language by fine-tuning on knowledge-base data.

3 Methodology

TODKAT combines topic representation learning, commonsense knowledge, and a Transformer encoder-decoder to predict dialogue emotion-label sequences. Its topic-driven language model is fine-tuned on dialogue data, while knowledge is retrieved or generated and selectively integrated.

  • Problem Setup: The task maps each utterance in a dialogue to an emotion label using a sequence-to-sequence framework conditioned on earlier utterances and predicted labels.At each step, subsequent utterances are unseen, and training optimizes the log-likelihood of predicted labels.
  • Overall Architecture: TODKAT has two components: a topic-driven language model fine-tuned on dialogues and a knowledge-aware Transformer for emotion-label sequence prediction.The architecture is described as the combination of topic representation learning and knowledge-aware sequence prediction.
  • Topic Representation Learning: The topic module adds a topic layer to a pre-trained language model and fine-tunes it on conversational text to learn latent topic representations.The model retains pre-trained weights to transfer representations from high-resource tasks into low-resource dialogue emotion datasets.
  • Topic Representation Learning: A variational autoencoder operates at each dialogue time step, with latent variables linked through recurrent hidden states to encourage coherent topics across a dialogue.The encoder produces a latent vector from each utterance, while the decoder reconstructs the utterance; training uses an Evidence Lower Bound objective.
  • Commonsense Knowledge Retrieval: Commonsense knowledge is obtained from ATOMIC2 by retrieving similar events with SBERT and by generating relation-specific events with COMET.The method uses intentions and subject or object reactions from three event relations: xIntent, xReact, and oReact.
  • Knowledge-Aware Transformer: A pointer network selects knowledge from retrieved or generated candidates, and attention aggregates the selected knowledge with utterance representations.The integrated topic, language-model, and knowledge representations are passed to a Transformer encoder-decoder that predicts the emotion-label sequence.

4 Experimental Setup

The experiments evaluate dialogue emotion detectors on four benchmarks using established baselines, predefined dataset splits, and F1-based comparisons. The setup includes topic-driven fine-tuning and knowledge-aware Transformer variants.

  • Datasets: The evaluation uses DailyDialog, MELD, IEMOCAP, and EmoryNLP as dialogue emotion detection benchmarks.DailyDialog and MELD use Ekman’s six emotions plus neutral, while IEMOCAP uses six different labels including excited and frustrated.
  • Evaluation protocol: DailyDialog excludes the neutral label from evaluation because of highly imbalanced classes.For MELD and EmoryNLP, dialogues are defined as utterance sequences from the same scene ID.
  • Baselines: The comparison includes recurrent, graph-based, knowledge-aware, and commonsense-knowledge dialogue emotion detectors.The listed baselines include HiGRU, DialogueGCN, KET, and COSMIC.
  • Evaluation protocol: Table 2 reports F1 results for TODKAT, ten-run averages, baseline systems, and ablations removing topics or knowledge.The table also compares commonsense knowledge obtained with COMET and SBERT.
  • Implementation: Topic-driven fine-tuning is implemented by modifying the Hugging Face language-model fine-tuning script.The model uses one Transformer encoder layer and a decoder with N layers, where N is the number of dialogue utterances.

5 Results and Analysis

TODKAT outperforms key baselines on most evaluated datasets, while ablations and analyses indicate that topic modeling, commonsense knowledge, and attention contribute to emotion detection. Learned topics also show measurable alignment with emotion patterns.

  • Comparison with Baselines: TODKAT outperforms COSMIC on MELD and EmoryNLP in weighted Avg-F1 by 3–5%, exceeds KET by over 10% on MELD and nearly 5% on DailyDialog, but trails COSMIC on IEMOCAP.The IEMOCAP comparison is not directly comparable because COSMIC used a different training size.
  • Ablation Study: Removing the topic component lowers performance across datasets except IEMOCAP, where weighted average F1 and Micro-F1 increase slightly.The authors attribute the IEMOCAP exception possibly to its small dataset size, which hinders topic discovery.
  • Ablation Study: Removing commonsense knowledge causes a nearly 10% F1 drop on EmoryNLP, while pointer-network selection balances mixed results from SBERT retrieval and COMET generation.The pointer network acts as a conciliator between the two knowledge-extraction methods across datasets.
  • Relationships between Topics and Emotions: Topic and emotion vector similarities correlate at 0.60, 0.58, 0.42, and 0.54 for DailyDialog, MELD, IEMOCAP, and EmoryNLP, respectively, with p-values ≪0.01.IEMOCAP has the lowest correlation, consistent with its lack of improvement from discovered latent topics.
  • Impact of Relation Type: Adding extra ATOMIC relation types degrades F1 on almost all datasets, except IEMOCAP, where adding sE and oE raises F1 by 0.5%.The additional event descriptions may provide complementary knowledge for IEMOCAP, which contains abundant events.
  • Impact of Attention Mechanism: Topic-driven attention directs the model toward more relevant retrieved events, correcting an erroneous ‘mad’ prediction for “Oh my God, you’re a freak.”The qualitative analysis links attention over knowledge phrases to the correct emotion label.

6 Conclusion

The proposed model combines topic representation, ATOMIC commonsense knowledge, and Transformer Encoder-Decoder Seq2Seq prediction for dialogue emotion detection. Empirical results indicate that topic representation learning and knowledge integration improve emotion-detection performance.

  • The model incorporates topic representation and commonsense knowledge from ATOMIC for dialogue emotion detection.
  • A fine-tuned topic-augmented language model extracts topics from dialogue context.
  • Pointer networks and additive attention support commonsense knowledge selection.
  • The components are integrated into a Transformer Encoder-Decoder structure that enables Seq2Seq prediction.
  • Empirical results show that topic representation learning and knowledge integration boost emotion-detection performance.

A.1 Settings

The implementation uses modified Hugging Face fine-tuning scripts and Transformers components, with RoBERTa as the language model. Training uses three epochs, a 5e-5 learning rate, and maximum utterance length of 128.

  • The implementation modifies a Hugging Face language-model fine-tuning script for topic-driven fine-tuning.
  • The topic model is trained for 3 epochs on each training set.
  • The learning rate is set to 5e-5 to prevent overfitting on low-resource datasets.
  • The language model is RoBERTa, implemented with the Transformers package.
  • Utterances shorter than the maximum length are padded with RoBERTa’s <pad> token, with the maximum length set to 128.
Loading 2106.01071v1…