Contextual Information and Commonsense Based Prompt for Emotion Recognition in Conversation

Jingjie Yi, Deqing Yang, Siyu Yuan, Kaiyan Cao, Zhiyao Zhang, Yanghua Xiao

Abstract

Emotion Recognition in Conversation (ERC) is a critical task in natural language processing that involves identifying the emotional state of speakers in a dialogue. Traditional methods often struggle with "emotional sparsity," where utterances lack explicit emotional keywords or rely on irony and context. This paper introduces CISPER (Contextual Information and commonSense based Prompt for Emotion Recognition), a framework that shifts ERC from standard fine-tuning to prompt-based learning. By integrating dialogue context and inferential commonsense knowledge into trainable "continuous prompts," CISPER effectively activates the latent knowledge within pre-trained language models. Evaluations on the MELD and EmoryNLP benchmarks demonstrate that CISPER achieves state-of-the-art results, with significant gains in recognizing rare emotion categories.

Introduction

Human communication is frequently nuanced, employing colloquialisms, irony, and implicit references that make emotion recognition difficult for machines. Most current ERC models utilize Pre-trained Language Models (PLMs) like RoBERTa but follow a "pre-train and fine-tune" paradigm. This approach often fails to fully exploit the rich knowledge embedded in PLMs and struggles when emotional cues are sparse.

To address these challenges, a model must understand both the context (the history of the conversation) and commonsense (the underlying intent or likely reactions of the participants). For example, an ironic statement like "What a good thing you've done!" in response to a mess requires contextual knowledge of the previous state and commonsense understanding of social norms to be correctly identified as "Anger" rather than "Joy."

A toy example showing how context and commonsense help identify "Anger" in an ironic statement.

Methodology

CISPER employs a three-step pipeline designed to treat ERC as a cloze-style task, aligning it more closely with the original pre-training objectives of PLMs.

1. Feature Extraction

The model first extracts semantic features from utterances using RoBERTa. Simultaneously, it generates nine types of commonsense inferences using COMET (trained on the ATOMIC knowledge graph). These inferences cover aspects such as the speaker's intent, the speaker's reaction, and the listener's reaction.

2. Continuous Prompt Generation

Unlike discrete prompts that use fixed text templates, CISPER utilizes trainable continuous prompts. Two Transformer encoders—one for the speaker's state and one for the listener's—blend semantic context and commonsense features into pseudo-token embeddings. A Bi-LSTM layer is then used to capture sequential correlations between these embeddings.

3. Emotion Prediction

The target utterance is wrapped in a symmetrical prompt template: [CLS][Prompt_Left][MASK][Utterance][Prompt_Right][SEP]. The PLM predicts the word at the [MASK] position, which is then mapped to an emotion category (e.g., Joy, Anger, Sadness) via a predefined thesaurus.

The overall framework of CISPER, illustrating the flow from feature extraction to prompt-based prediction.

Experimental Results

The authors evaluated CISPER on two benchmarks derived from the TV show Friends: MELD and EmoryNLP.

Performance Benchmarks

CISPER achieved new state-of-the-art (SOTA) results on both datasets:

  • MELD: Reached a weighted-F1 score of 66.10%, outperforming the previous SOTA (COSMIC) by 0.89%.
  • EmoryNLP: Reached 39.86%, a 1.75% improvement over COSMIC.

Rare Emotion Recognition

One of the most significant advantages of the prompt-based approach is its effectiveness in few-shot scenarios. CISPER showed dramatic improvements in recognizing rare emotion categories on the MELD dataset, increasing the F1-score for "fear" by 13.17% and "disgust" by 12.02% compared to the baseline.

Discussion and Key Insights

  • Prompting vs. Fine-tuning: By framing ERC as a masked language modeling task, CISPER better activates the internal knowledge of the PLM compared to traditional classification heads.
  • Symmetry in Templates: Symmetrical prompts (placing tokens on both sides of the utterance) were found to be more effective than one-sided prompts, likely providing a more balanced context for the prediction.
  • Context vs. Commonsense: Ablation studies indicated that while both are vital, contextual information generally provides a larger performance boost than commonsense alone.

Limitations and Future Work

Despite its success, CISPER is sensitive to the number of pseudo-tokens used in the prompt; the authors identified three tokens as the optimal balance. Additionally, the model currently relies on a manually curated thesaurus for mapping predicted words to emotions. Future research could focus on automating this mapping and optimizing the computational overhead associated with generating complex continuous prompts.

Summary updated

BibTeX
@inproceedings{yi2022contextual,
  author = {Jingjie Yi and Deqing Yang and Siyu Yuan and Kaiyan Cao and Zhiyao Zhang and Yanghua Xiao},
  title = {{Contextual Information and Commonsense Based Prompt for Emotion Recognition in Conversation}},
  booktitle = {ECML/PKDD},
  year = {2022},
  url = {https://openreview.net/forum?id=9CfTtXlGXG4},
}

Loading related content...

Figure