计算机科学与探索 ›› 2023, Vol. 17 ›› Issue (4): 953-963.DOI: 10.3778/j.issn.1673-9418.2106060

• 人工智能·模式识别 • 上一篇    下一篇

结合微调与重排序的情感可控对话生成方法

杜宝祥,马志强,王春喻,贾文超,王洪彬   

  1. 1. 内蒙古工业大学 数据科学与应用学院,呼和浩特 010080
    2. 内蒙古自治区基于大数据的软件服务工程技术研究中心,呼和浩特 010080
  • 出版日期:2023-04-01 发布日期:2023-04-01

Emotion Controllable Dialogue Generation Method Combining Fine-Tuning and Reranking

DU Baoxiang, MA Zhiqiang, WANG Chunyu, JIA Wenchao, WANG Hongbin   

  1. 1. College of Data Science and Application, Inner Mongolia University of Technology, Hohhot 010080, China
    2. Inner Mongolia Autonomous Region Engineering and Technology Research Centre of Big Data Based Software Service, Hohhot 010080, China
  • Online:2023-04-01 Published:2023-04-01

摘要: 现有的情感对话生成方法通常以基于序列到序列(Seq2Seq)的对话生成模型为基础,在编码或解码进行情感方面的改进,该类方法虽然能够实现一定的情感回复生成能力,但容易出现低质量的通用回复问题。为解决以上问题,实现情感可控且高质量的回复生成,提出了一种结合微调与重排序的情感可控对话生成方法,称为情感生成式预训练Transformer(EmoGPT)。在模型训练阶段,提出使用带有情感类别标签的对话语料微调GPT-2模型的方法,使其学习语句中语义和情感的依赖关系;在回复生成阶段,提出情感重排序策略对生成的多句回复进行情感打分并排序,以提高回复情感可控性。在使用带有情感标签的对话数据集的情感回复生成实验结果显示,带有情感重排序策略的EmoGPT在生成回复的内容相关性和情感一致性方面取得了领先于对比模型的性能,从而验证了文中方法的情感可控且高质量的回复生成能力。

关键词: 对话回复生成, 情感可控, 微调, 情感重排序, 内容相关性, 情感一致性

Abstract: The existing emotional dialogue generation methods are usually based on the sequence-to-sequence (Seq2Seq) dialogue generation models, and improve the encoding or decoding in terms of emotion. This method can achieve a certain extent of emotional response generation abilities but is prone to low-quality and common response problems. To solve these problems and achieve emotion controllable and high-quality response generation, this paper proposes an emotion controllable dialogue generation method combining fine-tuning and reranking, called EmoGPT (emotional generative pre-trained transformer). In the model training phase, a method for fine-tuning the GPT-2 model using dialogue corpus with emotion category labels is proposed to learn the semantic and emotional dependence of the sentences; in the response generation phase, an emotion reranking strategy is proposed to score and sort the generated multiple responses to improve the controllability of the response emotions. Experimental results of emotional response generation using a dialogue dataset with emotion labels show that EmoGPT with an emotion reranking strategy achieves better performance than comparison models in terms of content relevance and emotion consistency of the generated responses, thus verifying the ability of the proposed method to generate emotion controllable and high-quality responses.

Key words: dialogue response generation, emotion controllable, fine-tuning, emotion reranking, content relevance, emotion consistency