Please wait a minute...
浙江大学学报(工学版)  2022, Vol. 56 Issue (3): 520-530    DOI: 10.3785/j.issn.1008-973X.2022.03.011
计算机与控制工程     
基于知识迁移和双向异步序列的对话生成模型
王勇超1(),曹钰2,杨玉辉1,许端清2,*()
1. 浙江大学 信息技术中心,浙江 杭州 310027
2. 浙江大学 计算机科学与技术学院,浙江 杭州 310027
Dialogue generation model based on knowledge transfer and two-direction asynchronous sequence
Yong-chao WANG1(),Yu CAO2,Yu-hui YANG1,Duan-qing XU2,*()
1. Information Technology Center, Zhejiang University, Hangzhou 310027, China
2. College of Computer Science and Technology, Zhejiang University, Hangzhou 310027, China
 全文: PDF(1025 KB)   HTML
摘要:

针对端到端的对话生成模型普遍存在无意义安全回复和大量重复词汇的问题,和将外部知识引入对话系统的挑战,提出基于知识迁移和双向异步序列的对话生成模型.将知识库中的外部知识融合到对话生成模型并显式地生成在回复语句中;使用预训练的知识库问答模型获取输入语句的知识表达、候选知识表达以及关键字;搭建2个编码器?解码器结构,通过双向异步解码将关键字显式地生成在对话回复中;编、解码阶段均引入预训练模型的知识理解和知识表达能力,提升对话生成对知识信息的捕捉能力.提出重复检测惩罚机制,通过赋予惩罚权重的方式减少对话生成中的重复词汇.实验结果表明,所提模型在自动评估和人工评价指标上均优于已有的对话生成方法.

关键词: 对话生成知识实体知识库问答双向异步生成序列到序列模型    
Abstract:

A dialogue generation model based on knowledge transfer and two-direction asynchronous sequence generation was proposed, aiming to the generally meaningless safe replies and the problem of a large number of repetitive words in view of the end-to-end dialogue generation models, and the challenge of introducing external knowledge into the dialogue system. The external knowledge in the knowledge base was fused into the dialogue generation model and explicitly generated in the reply sentences. A pre-trained model based on the question and answering of the knowledge base was used to obtain the knowledge expressions of the input sentences, the knowledge expressions of the candidate answers, and keywords. The keywords were then used in the reply. Two encoder-decoder structure models were proposed, and the keywords were generated explicitly in the dialogue reply by two-direction asynchronous generation. The knowledge expressions and understanding capabilities of the pre-trained model were introduced to capture knowledge information to dialog generation at the encoding and decoding stages. A repetitive detection-penalty mechanism was proposed to reduce the repeated words problem by giving weight to punish the repetitive words. Experimental results show that the model outperforms better than existing methods in both automatic evaluation and manual evaluation indicators.

Key words: dialogue generation    knowledge entity    knowledge base question and answer    two-direction asynchronous generation    sequence-to-sequence model
收稿日期: 2021-07-11 出版日期: 2022-03-29
CLC:  TP 391  
基金资助: 国家重点研发计划资助项目(2020YFC1523101, 2019YFC1521304);浙江省重点研发计划资助项目(2021C03140);宁波市2021科技创新重大专项(20211ZDYF020028)
通讯作者: 许端清     E-mail: ychwang@zju.edu.cn;xdq@cs.zju.edu.cn
作者简介: 王勇超(1975—),男,高级工程师,从事计算机视觉与自然语言处理研究. orcid.org/0000-0001-6394-4701. E-mail: ychwang@zju.edu.cn
服务  
把本文推荐给朋友
加入引用管理器
E-mail Alert
作者相关文章  
王勇超
曹钰
杨玉辉
许端清

引用本文:

王勇超,曹钰,杨玉辉,许端清. 基于知识迁移和双向异步序列的对话生成模型[J]. 浙江大学学报(工学版), 2022, 56(3): 520-530.

Yong-chao WANG,Yu CAO,Yu-hui YANG,Duan-qing XU. Dialogue generation model based on knowledge transfer and two-direction asynchronous sequence. Journal of ZheJiang University (Engineering Science), 2022, 56(3): 520-530.

链接本文:

https://www.zjujournals.com/eng/CN/10.3785/j.issn.1008-973X.2022.03.011        https://www.zjujournals.com/eng/CN/Y2022/V56/I3/520

图 1  基于知识迁移和双向异步序列的对话生成模型总体架构图
问题
关系级 词汇级
written_by Harry Potter JK
1:Is JK the author of the Harry
Potter?
the author of the Harry
Potter
author
2:What book is written by JK? is written by book written
表 1  文本匹配不同粒度的三元组示例
图 2  BiLSTM网络中单一神经元结构图
图 3  BiLSTM网络结构图
模型 问答对/对话回复数据集 知识库数据集
名称 数量 名称 数量
知识库问答 训练集 75 910 实体 2×106
验证集 10 845 关系 31 940
测试集 21 687 三元组 1×107
对话生成 Reddit 训练集 3 384 185 实体 2×106
Reddit 验证集 8 000 关系 31 940
Reddit 测试集 16 000 三元组 1×107
Daily Dialog 训练集 41 982 实体 2×106
Daily Dialog 验证集 4 000 关系 31 940
Daily Dialog 测试集 8 000 三元组 1×107
表 2  本研究所用数据集详情
评估层面 分值 标准
语言 0 生成回复语句不通顺且语法不正确
1 生成回复语句不通顺但语法正确
2 生成回复语句通顺但语法存在歧义
3 生成回复语句通顺且语法完全正确
知识 0 生成回复语句中完全没有引入事实知识
1 生成回复语句中引入部分事实知识
2 生成回复语句中引入事实知识全面但不准确
3 生成回复语句中引入事实知识全面且准确
表 3  评价对话生成模型的人工评价标准
模型 BLEU PPL ES
Reddit Daily Dialog Reddit Daily Dialog Reddit Daily Dialog
Seq2Seq 0.21 0.23 54.94 67.23 0.564 0.443
CopyNet 0.27 0.22 47.54 54.78 0.932 0.769
CCM 0.24 0.25 43.78 57.45 1.034 0.947
TransDG 0.34 0.33 40.19 48.19 1.148 1.026
本研究 0.39 0.37 38.77 44.83 1.482 1.279
表 4  不同模型的自动评估结果统计
模型 ${{R} }_{\text{l} }$ ${{R} }_{\text{k} }$ ${{R} }_{\text{h} }$
Seq2Seq 0.49 0.80 0.65
CopyNet 1.08 1.47 1.28
CCM 0.96 1.87 1.42
TransDG 2.13 1.79 1.96
原始数据 2.84 2.56 2.70
本研究 2.32 1.95 2.14
表 5  不同模型的人工评价结果统计
模型 文本类型 文本内容
原始数据 输入 Interstellar is a pretty good movie. we will tell you it is a documentary.
原始数据 回复 I gonna watch that one next week! I like documentary. But I heard the ending to interstellar is just awful.
Seq2Seq 生成回复 It’s a movie, but it’s not.
CopyNet 生成回复 I 'm really very sorry but movies can be documentary.
CCM 生成回复 I’m not a movie, but I’m not a movie.
TransDG 生成回复 I’m a fan of movie, but I have not watched it yet.
本研究 生成回复 Documentary is a genre of movies, but I'll have to take your word for watching it.
表 6  不同模型生成回复的实例对比
1 FERGUSON G, ALLEN J, MILLER B. TRAINS-95: towards a mixed-initiative planning assistant [C]// Proceedings of the Third Conferece on Artificial Intelligence Planning Systems. Edinburgh: [s.n.], 1996: 70-77.
2 GRAESSER A C, CHIPMAN P, HAYNES B C, et al AutoTutor: an intelligent tutoring system with mixed-initiative dialogue[J]. IEEE Transactions on Education, 2005, 48 (4): 612- 618
doi: 10.1109/TE.2005.856149
3 WANG H, LU Z, LI H, et al. A dataset for research on short-text conversations [C]// Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing. Seattle: ACL, 2013: 935-945.
4 RITTER A, CHERRY C, DOLAN W B. Data-driven response generation in social media [C]// Proceedings of the 2011 Conference on Empirical Methods in Natural Language Processing. Edinburgh: ACL, 2011: 583-593.
5 VINYALS O, LE Q V. A neural conversational model [EB/OL]. [2021-06-22]. https://arxiv.org/pdf/1506.05869v1.pdf.
6 SHANG L, LU Z, LI H. Neural responding machine for short-text conversation [C]// Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Language Processing. Beijing: ACL, 2015: 1577-1586.
7 SERBAN I, SORDONI A, BENGIO Y, et al. Building end-to-end dialogue systems using generative hierarchical neural network models [C]// Proceedings of the AAAI Conference on Artificial Intelligence. Phoenix: AAAI, 2016: 3776-3783.
8 LI J, GALLEY M, BROCKETT C, et al. A diversity-promoting objective function for neural conversation models [C]// The 2016 Conference of the North American Chapter of the Association for Computational Linguistics. San Diego: [s.n.]. 2016: 110-119.
9 ZHOU H, YOUNG T, HUANG M, et al. Commonsense knowledge aware conversation generation with graph attention [C]// Proceedings of the 27th International Joint Conference on Artificial Intelligence. Stockholm: [s.n.]. 2018: 4623-4629.
10 LONG Y, WANG J, XU Z, et al. A knowledge enhanced generative conversational service agent [C]// Proceedings of the 6th Dialog System Technology Challenges (DSTC6) Workshop. Long Beach: [s.n.], 2017.
11 GHAZVININEJAD M, BROCKETT C, CHANG M W, et al. A knowledge-grounded neural conversation model [EB/OL]. [2021-06-22]. https://arxiv.org/pdf/1702.01932.pdf.
12 ZHU W, MO K, ZHANG Y, et al. Flexible end-to-end dialogue system for knowledge grounded conversation [EB/OL]. [2021-06-23]. https://arxiv.org/pdf/1709.04264v1.pdf.
13 LIU S, CHEN H, REN Z, et al. Knowledge diffusion for neural dialogue generation [C]// Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics. Melbourne: [s.n.], 2018: 1489-1498.
14 LIAN R, XIE M, WANG F, et al. Learning to select knowledge for response generation in dialog systems [C]// Proceedings of the 28th International Joint Conference on Artificial Intelligence. Macao: [s.n.], 2019: 5081.
15 WU S, LI Y, ZHANG D, et al. Diverse and informative dialogue generation with context-specific commonsense knowledge awareness [C]// Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics. Online: [s.n.], 2020: 5811-5820.
16 ZHOU S, RONG W, ZHANG J, et al. Topic-aware dialogue generation with two-hop based graph attention [C]// ICASSP 2021-2021 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP). Toronto: IEEE, 2021: 7428-7432.
17 XU H, BAO J, ZHANG G. Dynamic knowledge graph-based dialogue generation with improved adversarial meta-learning [EB/OL]. [2021-06-17]. https://arxiv.org/ftp/arxiv/papers/2004/2004.08833.pdf.
18 AUER S, BIZER C, KOBILAROV G, et al. DBpedia: a nucleus for a web of open data [M]// ABERER K, CHOI K-S, NOY N, et al. The semantic web. Heidelberg: Springer, 2007: 722-735.
19 BOSSELUT A, LE BRAS R, CHOI Y. Dynamic neuro-symbolic knowledge graph construction for zero-shot commonsense question answering [C]// Proceedings of the 35th AAAI Conference on Artificial Intelligence. Vancouver: AAAI, 2021: 4923-4931.
20 WANG J, LIU J, BI W, et al. Improving knowledge-aware dialogue generation via knowledge base question answering [EB/OL]. [2021-06-22]. https://arxiv.org/pdf/1912.07491v1.pdf.
21 CHAUDHURI D, RONY M R A H, LEHMANN J. Grounding dialogue systems via knowledge graph aware decoding with pre-trained transformers [C]// The Semantic Web 18th International Conference. Auckland: Springer, 2021: 323-339.
22 王勇超, 杨英宝, 曹钰, 邢卫 基于对抗学习和全局知识信息的关系检测技术研究[J]. 计算机应用研究, 2021, 38 (5): 1327- 1330
WANG Yong-chao, YANG Ying-bao, CAO Yu Research on relationship detection technology based on adversarial learning and global knowledge information[J]. Computer Application Research, 2021, 38 (5): 1327- 1330
23 MOU L, SONG Y, YAN R, et al. Sequence to backward and forward sequences: a content-introducing approach to generative short-text conversation [C]// Proceedings of COLING 2016, the 26th International Conference on Computational Linguistics: Technical Papers. Osaka: ACL, 2016: 3349-3358.
24 YU M, YIN W, HASAN K S, et al. Improved neural relation detection for knowledge base question answering [C]// Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics. Vancouver: [s.n.], 2017: 571-581.
25 GARDNER M W, DORLING S R Artificial neural networks (the multilayer perceptron): a review of applications in the atmospheric sciences[J]. Atmospheric Environment, 1998, 32 (14/15): 2627- 2636
26 CHO K, MERRIENBOER B, GULCEHRE C, et al. Learning phrase representations using RNN encoder-decoder for statistical machine translation [C]// Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing. Doha: ACL, 2014: 1724-1734.
27 张全聪 略谈英语词的重复形式[J]. 英语知识, 1991, (1): 30
ZHANG Quan-cong On the repetitive forms of English words[J]. English knowledge, 1991, (1): 30
28 BORDES A, USUNIER N, CHOPRA S, et al. Large-scale simple question answering with memory networks [EB/OL]. [2021-06-17]. https://arxiv.org/pdf/1506.02075.pdf.
29 LI Y, SU H, SHEN X, et al. DailyDialog: a manually labelled multi-turn dialogue dataset [C]// Proceedings of the Eighth International Joint Conference on Natural Language Processing. Taipei: AFNLP, 2017: 986-995.
30 CAI H, CHEN H, SONG Y, et al. Data manipulation: towards effective instance learning for neural dialogue generation via learning to augment and reweight [C]// Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics. Online: [s.n.], 2020: 6334-6343.
31 KIM S E, LIM Y S, PARK S B Strong influence of responses in training dialogue response generator[J]. Applied Sciences, 2021, 11 (16): 7415
doi: 10.3390/app11167415
32 PENNINGTON J, SOCHER R, MANNING C D. Glove: global vectors for word representation [C]// Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing. Doha: ACL, 2014: 1532-1543.
33 KINGMA D P, BA J. Adam: a method for stochastic optimization [C]// Proceedings of the 3rd International Conference on Learning Representations. San Diego: [s.n.], 2015.
34 SUTSKEVER I, VINYALS O, LE Q V. Sequence to sequence learning with neural networks [EB/OL]. [2021-06-17]. https://arxiv.org/pdf/1409.3215.pdf.
[1] 程若然,赵晓丽,周浩军,叶翰辰. 基于深度学习的中文字体风格转换研究综述[J]. 浙江大学学报(工学版), 2022, 56(3): 510-519, 530.
[2] 郑黄河,黄志球,李伟湋,喻垚慎,王永超. 基于自然近邻与协同过滤的API推荐方法[J]. 浙江大学学报(工学版), 2022, 56(3): 494-502.
[3] 李琳利,顾复,李浩,顾新建,罗国富,武志强,刚轶金. 仿生视角的数字孪生系统信息安全框架及技术[J]. 浙江大学学报(工学版), 2022, 56(3): 419-435.
[4] 童林,官铮,王立威,杨文韬,姚洋. 基于时序分解与误差修正的新能源爬坡事件预测[J]. 浙江大学学报(工学版), 2022, 56(2): 338-346.
[5] 王婷,朱小飞,唐顾. 基于知识增强的图卷积神经网络的文本分类[J]. 浙江大学学报(工学版), 2022, 56(2): 322-328.
[6] 何飞,金苍宏,吴明晖. 基于意图识别的不确定性行为序列预测方法[J]. 浙江大学学报(工学版), 2022, 56(2): 254-262.
[7] 刘英莉,吴瑞刚,么长慧,沈韬. 铝硅合金实体关系抽取数据集的构建方法[J]. 浙江大学学报(工学版), 2022, 56(2): 245-253.
[8] 农元君,王俊杰,陈红,孙文涵,耿慧,李书悦. 基于注意力机制和编码-解码架构的施工场景图像描述方法[J]. 浙江大学学报(工学版), 2022, 56(2): 236-244.
[9] 屠杭垚,王万良,陈嘉诚,李国庆,吴菲. 结合大气散射模型的生成对抗网络去雾算法[J]. 浙江大学学报(工学版), 2022, 56(2): 225-235.
[10] 温佩芝,陈君谋,肖雁南,温雅媛,黄文明. 基于生成式对抗网络和多级小波包卷积网络的水下图像增强算法[J]. 浙江大学学报(工学版), 2022, 56(2): 213-224.
[11] 董红召,方浩杰,张楠. 旋转框定位的多尺度再生物品目标检测算法[J]. 浙江大学学报(工学版), 2022, 56(1): 16-25.
[12] 王鑫,陈巧红,孙麒,贾宇波. 基于关系推理与门控机制的视觉问答方法[J]. 浙江大学学报(工学版), 2022, 56(1): 36-46.
[13] 陈彤,郭剑锋,韩心中,谢学立,席建祥. 基于生成对抗模型的可见光-红外图像匹配方法[J]. 浙江大学学报(工学版), 2022, 56(1): 63-74.
[14] 王浩远,梁煜,张为. 融合多分辨率表征的实时烟雾分割算法[J]. 浙江大学学报(工学版), 2021, 55(12): 2334-2341.
[15] 陈岳林,田文靖,蔡晓东,郑淑婷. 基于密集连接网络和多维特征融合的文本匹配模型[J]. 浙江大学学报(工学版), 2021, 55(12): 2352-2358.