-
增加了个人注释的GitHub代码
先说一下这个模型是干嘛的~
简介
基于Encoder-Decoder
方式的文本生成模型已成为NLG的主流,但是它存在诸如 (1)不可解释、(2)很难进行讲点或内容的选择这些缺点。
本文主要是对decoder
进行了改进,使用隐半马尔科夫HSMM
模型作为解码器,这种模型可以学习得到模板,这些模板是可控的而且也具有解释性。
该模型可以自动完成 讲点选择及排序、文本模板生成、模板槽位填充 几个过程,最终得到一句完整的话。
从四个方面来介绍代码的功能。
一、数据及数据准备
1.1 开源数据集E2E
E2E
是一个最大的餐饮领域的开源数据集。常用用于NM。就是一个连词成句的过程。
- mr: (textual meaning representation)就是“词”,类似属性名及属性值
- ref:生成的可阅读的句子
一个mr的例子
name[The Vaults],
eatType[pub],
priceRange[more than £30],
customer rating[5 out of 5],
near[Café Adriatic]
对应生成的句子
Near Café Adriatic is a five star rated, high priced pub called The Vaults.
The Vaults is a 5 stars pub with middle prices in Café Adriatic.
The Vaults Pub is close to Café Adriatic, it is five star rated and it has high prices
The Vaults is near Café Adriatic, it's a pub that ranges more than 30 and customers rate it 5 out of 5.
The Vaults is a five star, expensive public house situated close to Café Adriatic
There is an expe