对话模型-改写式回复生成模型-Response Generation by Context-aware Prototype Editing

文章目录

    • 介绍
    • 整体架构
    • Prototype Selector
    • Context-Aware Neural Editor
    • 结果

介绍

AAAI-2019

上下文敏感的改写式回复生成模型。在这个工作中,吴俣等人提出了一个新的范式:“先检索,后改写”,用于回复生成。在该框架中,首先利用检索式聊天机器人检索一个回复(原型),之后根据该回复原本的上下文和当前上下文之间的差异来改写此回复。这种新的范式不仅继承了检索式聊天机器人回复流畅和富有信息量的优势,而且还享有生成式聊天机器人的灵活性和相关性。实验表明,这一方法在相关性,多样性和原创性方面优于传统模型。

整体架构

对话模型-改写式回复生成模型-Response Generation by Context-aware Prototype Editing_第1张图片
论文地址:https://arxiv.org/pdf/1806.07042.pdf
code: https://github.com/MarkWuNLP/ResponseEdit

Prototype Selector

测试阶段

根据上下文C’和C的相似度,检索到context-response对。

训练阶段

based on the response similarity instead of context similarity,

不用context的原因是,一个context可能对于多个回复。根据实验结果,如果用context相似度,会产生没有意义的回复

因为有groundtruth 根据response计算相似度,检索到top20 相似的responses和对应的context
使用Jaccard相似度,取出范围在【0.3-0.7】的结果,使用2 bag of words
在这里插入图片描述
过滤掉小于0.3不相干的回复
舍弃大于0.7的回复,避免直接copy,鼓励多样性。

这样就获得了四元组
在这里插入图片描述

Context-Aware Neural Editor

Edit Vector Generation

根据C和C’生成一个edit vector
对话模型-改写式回复生成模型-Response Generation by Context-aware Prototype Editing_第2张图片
I是C中有的而C’中没有的,称为插入词集 D是C’中有的而C中没有的,称为删除词集

计算方法(注意力计算)
对话模型-改写式回复生成模型-Response Generation by Context-aware Prototype Editing_第3张图片
所以 edit vector就是:
在这里插入图片描述
即从上下文差异到回复差异的映射。
接下来就可以执行原型编辑

当然还有其他计算edit vector的方法:比如memory network

Prototype Editing

如图,将edit vector集成到seq2seq的decoder中。

在这里插入图片描述
对话模型-改写式回复生成模型-Response Generation by Context-aware Prototype Editing_第4张图片
式子(11)和(13)就是常规的注意力计算。
将edit vector加在每个embedding后面,这样编辑信息就可以在整个生成过程被用到。

目标函数
对话模型-改写式回复生成模型-Response Generation by Context-aware Prototype Editing_第5张图片

结果

对话模型-改写式回复生成模型-Response Generation by Context-aware Prototype Editing_第6张图片
对话模型-改写式回复生成模型-Response Generation by Context-aware Prototype Editing_第7张图片

你可能感兴趣的:(自然语言处理)