论文来源:EMNLP 2108

原文:《An Auto-Encoder Matching Model for Learning Utterance-Level Semantic Dependency in Dialogue Generation》

链接:

[1808.08795] An Auto-Encoder Matching Model for Learning Utterance-Level Semantic Dependency in Dialogue Generation?

arxiv.org

开源代码:

lancopku/AMM?

github.com
图标

本文为了解决在对话生成过程中的语义连贯性问题,提出了一种自动编码器匹配模型,其中包含两个自动编码器和一个映射模块。其中encoder和decoder层使用自动编码器学习问题和回答的语义表示,mapping模块用来学习问答话语级的语义关联。

整体模型架构如图:

模型结构图

encoder模块的本质上是一个基于LSTM的Seq2Seq模型,将该模块的编码器和解码器命名为「source-encoder」和「source-decoder」。source-encoder接收源文本x = {x1,x2,...,xn},并将其编码为内部表示h,然后将h解码为新序列 	ilde{x}={{	ilde{x}1,	ilde{x}2,...	ilde{x}n}} 。提取隐藏状态h作为语义表示。训练编码器减少损失函数,其损失函数定义如下:

decoder模块仅在测试时不提供答案输入,其他与encoder模块基本一致。构建回复的语义表示s,其损失函数定义如下:

mapping模块为了学习回复与问题在语义上的联系。本文仅使用简单的前馈网路来实现。 mapping模块将encoder模块中语义表示h变换为新的表示t。并通过最小化t和回复的语义表示s的L2范数训练它:

在测试阶段,给定输入话语,encoder模块、decoder模块和mapping模块一起工作产生对话响应。 encoder模块首先接收输入x并将其编码为源话语的语义表示h。 然后,mapping模块将h变换为回复响应表示t。 最后,将t发送到decoder以生成回复。

在训练阶段定义了一个端到端的损失函数J4:

最后定义整体的损失函数J:

实验结果:

BLEU scores for the AEM model and the Seq2Seq model

Diversity scores for the AEM model and the Seq2Seq model. Dist-1, Dist-2, and Dist-3 are respectively the number of distinct unigrams, bigrams, and trigrams in the generated text
Human evaluation results of the AEM model and the Seq2Seq model
Examples generated by the AEM model and the Seq2Seq model
中文语料问答结果

本文提出的模型在中文闲聊对话领域表现还是很不错的,相较于传统的seq2seq模型,生成的回答多样性及语义连贯性均有很大提升。相比于GAN模型,训练过程较为简单,且单句生成速度有所提升。


推荐阅读:
相关文章