Journal of Computer Applications ›› 2021, Vol. 41 ›› Issue (4): 1078-1083.DOI: 10.11772/j.issn.1001-9081.2020071063

Special Issue: 人工智能

• Artificial intelligence • Previous Articles     Next Articles

Topic-expanded emotional conversation generation based on attention mechanism

YANG Fengrui1,2,3, HUO Na1,2, ZHANG Xuhong1,2, WEI Wei1,2   

  1. 1. School of Communication and Information Engineering, Chongqing University of Posts and Telecommunications, Chongqing 400065, China;
    2. Research Center of New Telecommunication Technology Applications, Chongqing University of Posts and Telecommunications, Chongqing 400065, China;
    3. Chongqing Chongyou Information Technology (Group) Company Limited, Chongqing 401121, China
  • Received:2020-07-20 Revised:2020-09-13 Online:2021-04-10 Published:2020-10-19

基于注意力机制的主题扩展情感对话生成

杨丰瑞1,2,3, 霍娜1,2, 张许红1,2, 韦巍1,2   

  1. 1. 重庆邮电大学 通信与信息工程学院, 重庆 400065;
    2. 重庆邮电大学 通信新技术应用研究中心, 重庆 400065;
    3. 重庆重邮信科(集团)股份有限公司, 重庆 401121
  • 通讯作者: 霍娜
  • 作者简介:杨丰瑞(1963—),男,重庆人,教授,博士,主要研究方向:移动通信、大数据;霍娜(1996—),女,河南信阳人,硕士研究生,主要研究方向:大数据、对话系统;张许红(1994—),女,河南洛阳人,硕士研究生,主要研究方向:大数据、情感分析;韦巍(1996—),男,江苏苏州人,硕士研究生,主要研究方向:移动通信、无线传感。

Abstract: More and more studies begin to focus on emotional conversation generation. However, the existing studies tend to focus only on emotional factors and ignore the relevance and diversity of topics in dialogues, as well as the emotional tendency closely related to topics, which may lead to the quality decline of generated responses. Therefore, a topic-expanded emotional conversation generation model that integrated topic information and emotional factors was proposed. Firstly, the conversation context was globally-encoded, the topic model was introduced to obtain the global topic words, and the external affective dictionary was used to obtain the global affective words in this model. Secondly, the topic words were expanded by semantic similarity and the topic-related affective words were extracted by dependency syntax analysis in the fusion module. Finally, the context, topic words and affective words were input into a decoder based on the attention mechanism to prompt the decoder to generate topic-related emotional responses. Experimental results show that the model can generate rich and emotion-related responses. Compared with the model Topic-Enhanced Emotional Conversation Generation(TE-ECG), the proposed model has an average increase of 16.3% and 15.4% in unigram diversity(distinct-1) and bigram diversity(distinct-2); and compared with Seq2SeqA(Sequence to Sequence model with Attention), the proposed model has an average increase of 26.7% and 28.7% in unigram diversity(distinct-1) and bigram diversity(distinct-2).

Key words: emotional conversation generation, fusion module, topic model, Sequence to Sequence, (Seq2Seq) attention mechanism

摘要: 越来越多的研究开始聚焦于情感对话生成,然而现有的研究往往只关注情感因素,却忽视了对话中主题的相关性和多样性以及与主题密切相关的情感倾向,这可能导致生成响应的质量下降。因此提出一种融合主题信息和情感因素的主题扩展情感对话生成模型。该模型首先将对话上下文进行全局编码,引入主题模型以获得全局主题词,并使用外部情感词典获得全局情感词;其次在融合模块里利用语义相似度扩展主题词,并利用依存句法分析提取与主题相关的情感词;最后将上下文、主题词和情感词输入到一个基于注意力机制的解码器中,促使解码器生成主题相关的情感响应。实验结果表明,该模型能生成内容丰富且情感相关的回答。相较于主题增强情感对话生成模型(TE-ECG),所提出的模型在unigram多样性(distinct-1)和bigram多样性(distinct-2)上平均提高了16.3%和15.4%;相较于基于注意力机制的序列到序列模型(Seq2SeqA),所提出的模型在unigram多样性(distinct-1)和bigram多样性(distinct-2)上平均提高了26.7%和28.7%。

关键词: 情感对话生成, 融合模块, 主题模型, 序列到序列, 注意力机制

CLC Number: