Generating News Headlines with Recurrent Neural Networks
来源:互联网 发布:淘宝经典文案 编辑:程序博客网 时间:2024/06/05 07:13
Generating News Headlines with Recurrent Neural Networks
背景知识
seq2seq 的模型一般都是如下的结构 :
encoder 部分用单层或者多层 神经网络 将输入进行编码,decoder 部分是一个语言模型。这种生成式的问题都可以归结为求解一个条件概率问题 p(word|context),在 context 条件下,将词表中每一个词的概率值都算出来,用概率最大的那个词作为生成的词,依次生成摘要中的所有词。这里的关键在于如何表示 context,每种模型最大的不同点都在于 context 的不同,这里的 context 可能只是 encoder 的表示,也可能是 attention 和 encoder 的表示。decoder 部分通常采用 beam search 算法来做生成。
所以我们关注的问题是:
- 如何表达context?
- p(word|context)怎么求?
文本摘要 (Abstractive Sentence Summarization)
这里探讨的是用 abstractive 的方式来解决 sentence-level 的文本摘要问题,问题的定义比较简单,输入是一个长度为 M 的文本序列,输出是一个长度为 N 的文本序列,这里 M>>N,并且输出文本的意思和输入文本的意思基本一致,输入输出都可能是一句话,也可能是多句话。并且,输入输出拥有相同的词汇表。
Generating News Headlines with Recurrent Neural Networks
概要
这篇论文有三个发现:
1. 一个encoder-decoder recurrent neural network with LSTM units 和 attention框架去生成一个文本的摘要,可以取得较好的效果。
2. 神经网络如何决定哪些输入数据应该被关注。
3. simplified attention mechanism中不同神经元的功能,并且观察到,simplified attention mechanism比the more complex attention mechanism有更好的表现。
模型
decoder在输出每个word的时候,使用attention mechanism。对于每个输出的词,attention mechanism都计算出每个输入words的权值,权值累加和为1。在处理完每个输入words后,计算最后一层隐藏层生成的加权平均值,将这个值作为context和当前最后一层隐藏层一起输入到softmax layer。
论文里提出两种attention mechanism:
第一种: complex attention
模型中的 attention weights 是用 encoder 中每个词最后一层 hidden layer 的表示与当前 decoder 最新一个词最后一层 hidden layer 的表示做点乘,然后归一化来表示的。
具体公式:
- 当输出
t′ 个word的时候,怎么计算输入words在t位置的attention weight:ayt′(t)=exp(hTxthyt′)∑Tt−exp(hTxt−hyt′) hxt 表示处理第t个输入word后,最后一层隐藏层生成hyt′ 表示当前decoding的最后一层隐藏层生成 - softmax function:
oyt‘=Wcocyt‘+Whohyt‘+bo cyt‘ 是当前decodering步骤下的contexthyt‘ 是当前decodering步骤下的最后一层隐藏层生成Wco,Who和bo 是模型的参数
具体过程:
- 输入word为[x1,x2,x3,…,xT],其隐藏层最后一层为[h1,h2,h3,…,hT];
- 输出word为[y1,y2,y3,…,yT], 其隐藏层最后一层为[o1,o2,o3,…,oT];
- 通过上面的公式,计算每个输出word对应的attention weight为[a1,a2,a3,…,aT];
- 计算每个输出word对应的context=a1h1+a2h2+a3h3+…+aThT;
- 算出输出第i个word对应的context和oi一起输入softmax layer算出对应的第i个word.
具体图示:
第二种:Simple attention
这个模型将最后一层 hidden layer 细分了不同的作用。将 encoder和decoder 部分在每个词最后一层 hidden layer 的表示分为两块,一小块用来计算 attention weights 的,另一大块用来作为 encoder 的表示。计算attention weights的公式做相应的改变,计算context的公式不变。
具体图示:
注:这里只是对论文模型的理解,不包括其他内容。有兴趣,可以自行阅读原文。
- Generating News Headlines with Recurrent Neural Networks
- Generating Sequences With Recurrent Neural Networks(1)
- Supervised Sequence Labelling with Recurrent Neural Networks
- Chinese Poetry Generation with Recurrent Neural Networks
- Recurrent Neural Networks with Word Embeddings¶
- Chinese Poetry Generation with Recurrent Neural Networks
- Gated Recurrent Neural Networks
- Recurrent Neural Networks Tutorial
- Recurrent Neural Networks - collections
- Recurrent Neural Networks regularization
- Recurrent Neural Networks
- Recurrent Neural Networks
- speech recognition with deep recurrent neural networks-论文笔记
- 【每周一文】Supervised Sequence Labelling with Recurrent Neural Networks
- Labelling Unsegmented Sequence Data with Recurrent Neural Networks(笔记)
- Context-aware Natural Language Generation with Recurrent Neural Networks
- #Paper Reading# Abstractive Sentence Summarization with Attentive Recurrent Neural Networks
- [ICLR2017]Tree-Structured Deconding with Doubly-Recurrent Neural Networks
- 51Nod-1390-游戏得分
- jQuery使用ajaxSubmit()提交表单示例
- DOM解析XML和生成
- 时钟三:用内部中断实现时钟
- Tarjan求强连通分量算法
- Generating News Headlines with Recurrent Neural Networks
- UnityShader - 基础 - Normal Map 法线贴图
- 初中OJ1996【2015.8.3普及组模拟赛】WZK旅游(seek)
- [无源汇最大费用可行流 差分费用流] Codeforces 717G Bubble Cup 9 - Finals G. Underfail
- 键盘移动面向对象
- thinphp or and操作
- LIS,LCS,一道LIS题
- iOS 9 failed for URL: "XXX://@" - error: "This app is not allowed to query for scheme XXX" iOS 从APP里
- 【Hibernate】一对多关联映射