ShowMeAI为斯坦福CS224n《自然语言处理与深度学习(Natural Language Processing with Deep Learning)》课程的全部课件,做了中文翻译和注释,并制作成了GIF动图!
本讲内容的深度总结教程可以在这里 查看。视频和课件等资料的获取方式见文末。
(本篇内容也可以参考ShowMeAI的对吴恩达老师课程的总结文章深度学习教程 | 序列模型与RNN网络)
语言建模的任务是预测下一个单词是什么
更正式的说法是:给定一个单词序列 \boldsymbol{x}^{(1)}, \boldsymbol{x}^{(2)}, \ldots, \boldsymbol{x}^{(t)},计算下一个单词 x^{(t+1)} 的概率分布:
the students opened their __
the
, students
, opened
, their
the students
, students opened
, opened their
the students opened
, students opened their
the students opened their
假设我们正在学习一个 4-gram 的语言模型
students opened their
出现了1000次students opened their books
出现了400次students opened their exams
出现了100次proctor
吗?proctor
,所以 exams
在这里的上下文中应该是比 books
概率更大的。students open their ww
从未出现在数据中,那么概率值为0students open their
从未出现在数据中,那么我们将无法计算任何单词 w 的概率值open their
,也叫做后退处理。问题:需要存储你在语料库中看到的所有 n-grams 的计数
增加 n 或增加语料库都会增加模型大小
Try for yourself: https://nlpforhackers.io/language-models/
稀疏性问题:
today the company
和today he bank
都是4/26,都只出现过四次超越 n-gram 语言模型的改进
NNLM存在的问题
我们需要一个神经结构,可以处理任何长度的输入
Source: https://medium.com/@samim/obama-rnn-machine-generated-political-speeches-c8abd18a2ea0
Source: https://medium.com/deep-writing/harry-potter-written-by-artificial-intelligence-8a9431803da6
Source: https://gist.github.com/nylki/1efbaa36635956d35bcc
Source: http://aiweirdness.com/post/160776374467/new-paint-colors-invented-by-neural-network
补充讲解
Source: https://research.fb.com/building-an-efficient-neural-language-model-over-a-billion-words/
可以点击 B站 查看视频的【双语字幕】版本
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。