介绍

AAAI-2019

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

整体架构

对话模型-改写式回复生成模型-Response Generation by Context-aware Prototype Editing
论文地址: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
对话模型-改写式回复生成模型-Response Generation by Context-aware Prototype Editing
过滤掉小于0.3不相干的回复
舍弃大于0.7的回复,避免直接copy,鼓励多样性。

这样就获得了四元组
对话模型-改写式回复生成模型-Response Generation by Context-aware Prototype Editing

Context-Aware Neural Editor

Edit Vector Generation

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

计算方法(注意力计算)
对话模型-改写式回复生成模型-Response Generation by Context-aware Prototype Editing
所以 edit vector就是:
对话模型-改写式回复生成模型-Response Generation by Context-aware Prototype Editing
即从上下文差异到回复差异的映射。
接下来就可以执行原型编辑

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

Prototype Editing

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

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

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

结果

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

相关文章:

  • 2021-05-17
  • 2021-10-05
  • 2022-01-18
  • 2022-01-09
  • 2021-12-20
  • 2022-01-13
猜你喜欢
  • 2021-10-28
  • 2021-10-21
  • 2021-05-05
  • 2022-02-02
  • 2021-05-01
  • 2021-11-23
  • 2021-08-02
相关资源
相似解决方案