Source-linked AI summary

Emotional Chatting Machine: Emotional Conversation Generation with Internal and External Memory

Hao Zhou, Minlie Huang, Tianyang Zhang, Xiaoyan Zhu, Bing Liu

arXiv:1704.01074v4cs.CLcs.AI

TL;DR

Large-scale conversation generation had not addressed emotion despite its importance for dialogue systems. ECM combines emotion-category embeddings with internal and external memory mechanisms, and experiments report responses appropriate in both content and emotion, with higher content and emotion scores than traditional Seq2Seq. The paper notes noisy automatic emotion labels and insufficient training data for some categories as limitations.

  • Problem

    Existing large-scale neural conversation models focused mainly on content, leaving emotion unaddressed despite its relevance to dialogue quality.

  • Method

    ECM uses emotion category embedding, an internal emotion memory for dynamic state changes, and an external memory for explicit emotion-word selection.

  • Results

    ECM generates responses appropriate in content and emotion and achieves higher content and emotion scores than traditional Seq2Seq.

  • Takeaways & Limitations

    ECM provides a framework for incorporating emotionally consistent responses into large-scale conversation generation.

  • Takeaways & Limitations

    The ESTC emotion labels are noisy because they are automatically annotated, and some emotion categories have insufficient training data.

Abstract

from arXiv · show

Perception and expression of emotion are key factors to the success of dialogue systems or conversational agents. However, this problem has not been studied in large-scale conversation generation so far. In this paper, we propose Emotional Chatting Machine (ECM) that can generate appropriate responses not only in content (relevant and grammatical) but also in emotion (emotionally consistent). To the best of our knowledge, this is the first work that addresses the emotion factor in large-scale conversation generation. ECM addresses the factor using three new mechanisms that respectively (1) models the high-level abstraction of emotion expressions by embedding emotion categories, (2) captures the change of implicit internal emotion states, and (3) uses explicit emotion expressions with an external emotion vocabulary. Experiments show that the proposed model can generate responses appropriate not only in content but also in emotion.

Introduction

Large-scale dialogue models have largely prioritized content while leaving emotion underaddressed. ECM introduces an end-to-end approach that incorporates emotion into response generation through three mechanisms and reports higher content and emotion scores than traditional Seq2Seq.

  • Emotion perception and expression are presented as necessary for chatbot communication at a human level.
  • Prior emotion-aware dialogue studies were mostly rule-based or small-scale, while neural conversation models generally focused on content and did not address emotion.
  • Large-scale emotional response generation must obtain emotion labels, balance grammaticality with emotion, and avoid implicit or ambiguous expressions.The paper reports that generic, hard-to-perceive expressions account for 73.7% of emotional responses in its dataset.
  • ECM is an end-to-end framework for emotion-aware large-scale conversation generation with emotion category embedding, internal emotion memory, and external memory.
  • ECM is reported to generate responses with higher content and emotion scores than the traditional Seq2Seq model.

Related Work

Earlier emotion-aware dialogue systems were limited by rule-based designs or small datasets, while newer controllable text-generation methods used linguistic tools, attributes, or customized parameters. ECM is positioned as a fully data-driven approach to emotion-aware large-scale conversation generation.

  • Earlier work on affective dialogue was mainly rule-based or limited to small data, restricting its application to large-scale conversation generation.
  • No prior work had addressed the emotion factor in large-scale conversation generation, according to the paper.
  • Related controllable-generation studies conditioned text on sentiment, tense, affect categories, grammar, or topics.
  • The paper distinguishes ECM from prior methods by describing it as fully data-driven rather than heavily dependent on linguistic tools or customized parameters.

Emotional Chatting Machine

ECM extends a GRU encoder-decoder to generate responses conditioned on an emotion category while modeling emotion dynamically and explicitly. Its internal memory tracks changing emotion states, and its external memory balances emotion and generic vocabulary generation.

  • Base Framework: The decoder uses context and the previous word embedding in a GRU, then computes the next-token distribution from the decoder state.The context vector dynamically attends to key information in the input post.
  • Task Definition: ECM generates a response conditioned on a post and a specified response emotion category, allowing multiple suitable emotions for the same post.The model estimates P(Y | X, e) over six emotion categories and leaves automatic response-emotion selection for future work.
  • Emotion Category Embedding: ECM feeds a learned emotion-category embedding into the decoder to capture a high-level abstraction of the response’s emotion expression.The embedding is combined with the previous word embedding and context vector before updating the decoder state.
  • Internal Memory: The internal memory models implicit emotion dynamics by reading emotion state into the decoder and updating that state through read and write gates during decoding.Repeated updates produce a decay effect, and the internal emotion state is intended to decay to zero at the final step.
  • External Memory: The external memory explicitly separates emotion and generic words, while a type selector weights their softmax distributions to form the final decoding distribution.The two vocabularies have no intersection, and the selector controls the choice between emotion and generic words.
  • Training Objective: ECM training combines token cross-entropy with regularization that drives the final internal emotion state toward zero and supervises emotion-versus-generic word selection.The external-memory regularization constrains selection of an emotional or generic word.

Data Preparation

Because off-the-shelf emotion-labeled data were unavailable, the authors first trained an emotion classifier and then used it to annotate the STC conversation dataset.

  • Data Preparation: The data preparation process trains an emotion classifier on the NLPCC dataset and uses it to annotate STC conversations for ECM.This produces the emotion-labeled corpus used in the subsequent experiments.

1. Building an Emotion Classifier.

The authors filter an eight-category manually annotated Weibo emotion dataset to six categories and compare several classifiers, with Bi-LSTM achieving the best reported accuracy.

  • Dataset: The NLPCC dataset contains 23,105 manually annotated Weibo sentences originally assigned to eight emotion categories.Fear and Surprise were removed because they represented only 1.5% and 4.4% of the data, leaving six categories.
  • Dataset: The filtered NLPCC dataset uses Angry, Disgust, Happy, Like, Sad, and Other as its six emotion categories.The categories are retained after removing infrequent Fear and Surprise classes.
  • Classifier Results: 0.623 accuracy was achieved by the Bi-LSTM classifier, outperforming the lexicon-based classifier and the other neural classifiers.The classifiers were trained after partitioning the data into training, validation, and test sets at an 8:1:1 ratio.

2. Annotating STC with Emotion.

The authors automatically annotate the STC Dataset with six emotion categories using a Bi-LSTM classifier, producing the emotion-labeled Emotional STC (ESTC) Dataset.

  • A Bi-LSTM classifier annotated the STC Dataset with six emotion categories.
  • The annotated corpus is called the Emotional STC (ESTC) Dataset.
  • The ESTC labels are noisy because they were generated automatically, but the dataset is considered adequate for training in practice.

Experiments

The experiments use a two-layer GRU sequence-to-sequence implementation and compare ECM with general and emotion-category-embedding baselines.

  • ECM uses two-layer GRU encoder and decoder networks, 100-dimensional word embeddings, and a vocabulary limited to 40,000 words.
  • The internal memory is a trainable 6×256 matrix, while the external memory contains 40,000 generic and emotion words.
  • Training uses mini-batch SGD with batch size 128 and learning rate 0.5, followed by 20 epochs of model training.
  • Because closely related baselines were unavailable, the study compares ECM with a general seq2seq model and an internally created emotion category embedding model.

Automatic Evaluation

Automatic evaluation measures content with perplexity and emotion with emotion accuracy. ECM achieves the strongest emotion accuracy, while its perplexity falls between the Seq2Seq and Emb models.

  • Perplexity evaluates content quality, while emotion accuracy measures agreement between the target and classifier-predicted emotion categories.
  • ECM achieves the best emotion accuracy; its perplexity is better than Seq2Seq but worse than Emb.
  • ECM's generated sentences are described as fluent and grammatical at a perplexity of 68.0, making emotion accuracy more important in practice.
  • Removing external memory produces the best perplexity among ablations, whereas removing it causes the largest decrease in emotion accuracy.
  • The internal memory helps balance grammar and emotion dynamically, while external memory explicitly selects emotion words.

Manual Evaluation

Human evaluation scores responses for content and emotion and finds that ECM performs best across their joint quality and preference measures, with weaker content performance for underrepresented emotions.

  • Three annotators rated randomized responses on Content and Emotion, using scales of 0–2 and 0–1 respectively.
  • The evaluation sampled 200 test posts and generated 1,200 responses per model.
  • Inter-rater agreement was 0.441 for Content and 0.757 for Emotion, corresponding to moderate and substantial agreement.
  • ECM outperforms other methods significantly on both Content and Emotion; Content improves from 1.256 for Emb to 1.299 for ECM.
  • ECM's Emotion performance exceeds other methods across all emotion categories, but its Content performance is worse for Disgust and Angry because training data are insufficient.
  • 27.2% of ECM responses scored 2-1 for Content-Emotion, compared with 22.8% for Emb and 9.0% for Seq2Seq.
  • Annotators significantly prefer ECM over the other methods, while emotion models are preferred over Seq2Seq.

Analysis of Emotion Interaction and Case Study

ECM models diverse emotion interactions and conditions responses on specified emotion categories. Case studies show appropriate responses for frequent interactions, while low-frequency interactions remain problematic.

  • Emotion interaction patterns: Emotion interaction patterns pair post and response categories, with darker cells representing higher conditional probabilities.The value of an interaction pattern is P(er|ep) = P(er, ep)/P(ep).
  • Emotion interaction patterns: Frequent interactions include Like or Happy responses to Happy posts, while diagonal patterns indicate emotional empathy.Other interaction patterns also occur, showing that conversational emotion interactions are diverse.
  • Case study: ECM generates appropriate responses conditioned on every specified emotion category, unlike Seq2Seq, which generates a random emotion.The examples support multiple suitable response emotions for a given post and motivate specifying emotion as an input.
  • Case study: ECM produces appropriate responses for frequent emotion interaction patterns and explicitly expresses emotion through its external memory during decoding.The external memory can select either generic or emotion words.
  • Case study: Low-frequency patterns such as <Happy, Disgust> and <Happy, Angry> yield inappropriate responses because of limited training data or emotion-classifier errors.The limitation appears in the final examples of Figure 4.

Conclusion and Future Work

ECM models emotion influence in large-scale conversation generation using three mechanisms and produces responses appropriate in both content and emotion. Future work would have the model choose response emotions, but this depends on topics, contexts, and user mood.

  • Conclusion: ECM uses emotion category embedding, internal emotion memory, and external memory to model emotion influence in large-scale conversation generation.
  • Conclusion: Objective and manual evaluations show that ECM generates responses appropriate in both content and emotion.
  • Future work: Future work would have ECM select the most appropriate response emotion instead of receiving a specified emotion class.The authors note that this task may depend on topics, contexts, or the user’s mood.
Loading 1704.01074v4…