Word embeding

给word 加feature,用来区分word 之间的不同,或者识别word之间的相似性.

  

用于学习 Embeding matrix E 的数据集非常大,比如 1B - 100B 的word corpos. 所以即使你输入的是没见过的 durian cutivator 也知道和 orange farmer 很相近. 这是transfter learning 的一个case.

  

  

  

  

因为t-SNE 做了non-liner 的转化,所以在原来的300维空间的平行的向量在转化过后的2D空间里基本上不会再平行.

  

看两个向量的相似性,可以用cosine similarity.

  

  

说了这么久 word embeding E 有这么大的用处,那E是怎么得到的呢?下面讲怎么learn embeding.

Learning embedings:Word2Vec&GloVe

就是怎么得到 E。

下图提到的在附近找一个词来做context 预测 target 词,就是Skip Gram 算法.

  

研究人员发现如果你真想要 build language model, 很自然的选择最近的一些words 作为context; 如果你是为了learn word embeding, 你可以选择任意下面的context都能得到很好的结果.

  

Word2Vec

前面讲了使用前4个word来学习参数 E 进而预测target word, 这里讲用1个word 来学习E并用来预测target word. 下图就是Word2Vec 的 Skip-grams model,还有一个叫 CBow.

  

Word2Vec 最大的问题就是计算p(t|c) 时候计算量很大.下图提到了hierachial softmax 的概念是一个解决的思路.

  

接下里有两种算法来解决上面讲到的softmax计算量大的问题

Negagtive Sampling

  

这个negative sampling model 把一次性计算softmax (在我们的例子里softmax 输出的维度是10k), 改成了多(10k)次(1个positive example, 4个随机选取的negative example)计算sigmoid.

  

到底怎么随机选取negative sampling 呢?去绝对随机,还是有什么方法?有两种极端,一种是根据经验取常见的word, 还有一种是在vacab 里绝对的随机选取,都不好, 下面给出了一个经验公式.但是我没搞懂那个p(wi) 怎么用到实际的选取中.

  

GloVe

  

  

  

Sentiment Classification

情感分析一个大问题是没有足够的label dataset.

Coursera, Deep Learning 5, Sequence Models, week2, Natural Language Processing & Word Embeddings的更多相关文章

  1. Coursera, Deep Learning 5, Sequence Models, week3, Sequence models & Attention mechanism

    Sequence to Sequence models basic sequence-to-sequence model: basic image-to-sequence or called imag ...

  2. 课程五(Sequence Models),第二 周(Natural Language Processing & Word Embeddings) —— 1.Programming assignments:Operations on word vectors - Debiasing

    Operations on word vectors Welcome to your first assignment of this week! Because word embeddings ar ...

  3. Coursera Deep Learning笔记 序列模型(二)NLP & Word Embeddings(自然语言处理与词嵌入)

    参考 1. Word Representation 之前介绍用词汇表表示单词,使用one-hot 向量表示词,缺点:它使每个词孤立起来,使得算法对相关词的泛化能力不强. 从上图可以看出相似的单词分布距 ...

  4. Coursera, Deep Learning 5, Sequence Models, week1 Recurrent Neural Networks

    有哪些sequence model Notation: RNN - Recurrent Neural Network 传统NN 在解决sequence input 时有什么问题? RNN就没有上面的问 ...

  5. 课程五(Sequence Models),第二 周(Natural Language Processing & Word Embeddings) —— 2.Programming assignments:Emojify

    Emojify! Welcome to the second assignment of Week 2. You are going to use word vector representation ...

  6. 课程五(Sequence Models),第二 周(Natural Language Processing & Word Embeddings) —— 0.Practice questions:Natural Language Processing & Word Embeddings

    [解释] The dimension of word vectors is usually smaller than the size of the vocabulary. Most common s ...

  7. Predicting effects of noncoding variants with deep learning–based sequence model | 基于深度学习的序列模型预测非编码区变异的影响

    Predicting effects of noncoding variants with deep learning–based sequence model PDF Interpreting no ...

  8. 吴恩达《深度学习》-课后测验-第五门课 序列模型(Sequence Models)-Week 2: Natural Language Processing and Word Embeddings (第二周测验:自然语言处理与词嵌入)

    Week 2 Quiz: Natural Language Processing and Word Embeddings (第二周测验:自然语言处理与词嵌入) 1.Suppose you learn ...

  9. [C5W2] Sequence Models - Natural Language Processing and Word Embeddings

    第二周 自然语言处理与词嵌入(Natural Language Processing and Word Embeddings) 词汇表征(Word Representation) 上周我们学习了 RN ...

随机推荐

  1. tfs 2013 利用 web deploy 完成asp.net站点自动发布

    课题起因: 目前我们团队使用visual studio 2013开发asp.net项目, 使用tfs2013 做源码管理, 每天早上手动发布项目文件包,复制到测试服务器的站点文件夹下覆盖老文件,用此方 ...

  2. Django(十八)Model操作补充

    参考博客:http://www.cnblogs.com/wupeiqi/articles/6216618.html 1. 创建类 class UserInfo(model.Model): age = ...

  3. 关于数据结构,剑指offer上面的

    我很喜欢那些javascript解决的编程题,感觉非常的有意思.我在博客园上面看到了一个同学的博客,他一共发了34篇剑指offer的编程题,还给出了非常详细的解答. 接下来的工作,我做的就是搬运工,不 ...

  4. Linux编译安装PHP参数说明

    php各参数配置详解 --prefix=/usr/local/php //指定 php 安装目录 --with-apxs2=/usr/local/apache/bin/apxs //整合apache, ...

  5. redis4.0.6集群搭建

    文件环境:CentOS7 + redis4.0.6 先去官网下载redis:https://redis.io/,然后上传到你的虚拟机,我上传到了/mysoft 先解压->然后进入主目录-> ...

  6. 随机数Random

    掷骰子10次,统计1.2出现的次数 public static void Main(string[] args) { ,a2=; Random random=new Random();//创建随机数对 ...

  7. Mac 上有哪些值得推荐的软件?冷门小众软件但实用

    确实Mac上有很多小众.冷门,但却是十分实用.值得推荐的工具,小编针对用的比较多的软件,整理了一些,希望有帮助. The Unarchive:解压缩工具 macOS 对于压缩文件的处理不是很好.如果你 ...

  8. 10款 Mac 系统优化清理工具软件推荐和下载

    本文内容及图片来源[风云社区 SCOEE] 在Windows上有各种安全卫士.系统助手等系统优化和清理工具,比如360安全卫士.腾讯安全管家等,同样MacOS系统也有很多好用的系统优化清理工具,体验比 ...

  9. python3.5和python3.6关于json模块的区别

    python3.5中 无法反序列化bytes数据必须decode成str才可以 >>> import json >>> a = b'{"username& ...

  10. 建立Heapster Influxdb Grafana集群性能监控平台

    依赖于kubenets dns服务 图形化展示度量指标的实现需要集成k8s的另外一个Addons组件: Heapster .Heapster原生支持K8s(v1.0.6及以后版本)和 CoreOS , ...