Knowledge-Enriched Transformer for Emotion Detection in Textual Conversations

Peixiang Zhong, Di Wang, Chunyan Miao

Introduction

Detecting emotions in textual conversations is a complex task. Unlike humans, who naturally integrate context and commonsense knowledge, machines often struggle to interpret utterances that lack explicit emotional keywords. The Knowledge-Enriched Transformer (KET) addresses this by combining the structural efficiency of Transformers with external knowledge bases like ConceptNet and NRC VAD. By dynamically weighing external concepts based on their relevance and emotional intensity, KET outperforms several state-of-the-art models across multiple conversational benchmarks.

The Challenge of Implicit Emotion

In a typical conversation, the emotional state of a speaker is often hidden behind neutral-sounding words. For instance, the phrase "I'll invite my friends home" might seem neutral in isolation. However, within the context of a "birthday" and a "party," it clearly signals happiness.

Illustrating how context and external knowledge (e.g., 'party') clarify emotional intent.

Humans use a vast web of associations—knowing that "parties" involve "socializing" and "celebrating"—to fill in these gaps. Previous models, largely based on Recurrent Neural Networks (RNNs), struggled to maintain these long-range dependencies or effectively integrate such external "commonsense" associations. The authors of KET aim to bridge this gap by creating a model that "understands" both the flow of the conversation and the underlying emotional associations of the words being used.

The KET Architecture

The KET model introduces a sophisticated pipeline to bridge the gap between raw text and emotional understanding. Its architecture consists of three main pillars designed to handle knowledge retrieval and hierarchical context.

Overview of the Knowledge-Enriched Transformer components.
  1. Knowledge Retrieval: For every non-stopword in an utterance, KET queries ConceptNet (a massive graph of general knowledge) to find related concepts and NRC VAD (a lexicon providing Valence, Arousal, and Dominance scores) to understand the emotional "vibe" of those concepts.
  2. Dynamic Context-Aware Affective Graph Attention: This is the core innovation. Instead of pulling in every related word, KET uses an attention mechanism to filter them. It calculates a weight for each concept based on its Relatedness to the global conversation context and its Affectiveness (how emotionally charged it is).
  3. Hierarchical Self-Attention: Conversations have a nested structure where words form utterances and utterances form a context. KET uses a two-stage attention process—first at the utterance level and then at the context level—to model this hierarchy more efficiently than standard "flat" Transformers.

Key Insights

Knowledge as an "Emotion Magnifier"

External knowledge acts as a bridge for implicit emotions. By linking "friends" to "socialize" and "party," the model can infer "happiness" even when no explicit emotion words are present. The paper demonstrates that prioritizing concepts with high emotional intensity (using VAD scores) significantly boosts performance.

Efficiency and Robustness

Despite its complexity, KET is remarkably efficient. It achieves state-of-the-art results with only 4 million parameters, a fraction of the 110 million parameters found in models like BERT_BASE. Furthermore, KET proved particularly robust in "unbalanced" datasets where the "neutral" class dominates, showing that knowledge enrichment helps pick out rare emotional signals from the noise.

Results and Evaluation

KET was evaluated on five diverse datasets: EC (Tweets), DailyDialog (daily communication), MELD and EmoryNLP (TV scripts from Friends), and IEMOCAP (acted emotional dialogues). The model outperformed state-of-the-art models (including DialogueRNN and BERT) on four out of the five datasets in terms of F1 score.

  • On DailyDialog, it achieved an F1 of 0.5337, a notable jump over the previous best of 0.5065.
  • On MELD, it reached 0.5818, outperforming both CNN+cLSTM and BERT.

Limitations and Future Work

While KET is highly effective, it fell slightly behind DialogueRNN on the IEMOCAP dataset. The authors attribute this to the fact that DialogueRNN explicitly models speaker dynamics (who is speaking to whom), whereas KET treats context more generally. Additionally, the model still struggles with rare emotions like "Disgust" and "Fear," which often share similar VAD profiles. Future work could involve using specific relation types in ConceptNet (e.g., "IsA" vs. "Causes") to further refine knowledge integration.

Summary updated

BibTeX
@inproceedings{zhong2019knowledge,
  author = {Peixiang Zhong and Di Wang and Chunyan Miao},
  title = {{Knowledge-Enriched Transformer for Emotion Detection in Textual Conversations}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2019},
  doi = {10.18653/v1/d19-1016},
}
Figure