Lec3.1 Word2vec

Language Models
A language model computes a probability for a sequence of words: P ( w 1 , … , w T ) P(w_1,\dots,w_T) P(w1,,wT)

最简单的用向量表示词的方式是One-hot,向量的长度是字典的大小,词的位置为1,其余位置为0.
term-frequency matix,行是次,列是文档,是文档用词的one-hot表示的和。

这种表示方式有两个缺点:向量太长了,向量不能表示语义关系,比如相似,相反的词。

那有什么解决方案呢?

  • Idea 1: Reduce the dimensionality(Dimensionality reduction)
    Singular Value Decomposition(SVD)
    X = U Σ V T X=U\Sigma V^T X=UΣVT
    – The columns of U contain the eigenvectors of X X T XX^T XXT.
    – The columns of V contain the eigenvectors of X T X X^TX XTX.
    Σ \Sigma Σ是对角矩阵。 σ 2 \sigma^2 σ2 X X T XX^T XXT X T X X^TX XTX的特征值。
    比如:latent semantic indexing(analysis)

这种方法的确定是计算量大, d ∗ n d*n dn的矩阵,时间复杂度为 O ( n d 2 ) , w h e n   d < n O(nd^2), when \ d \lt n O(nd2),when d<n,词量或文章量太大就不可能了。而且不在语料中的词和文章不能表示。因为这些缺点,所以会有下面的方法。

  • Idea 2: Learn low-dimensional vectors directly
    下面这些论文就是用这种方式实现的。
    Lec3.1 Word2vec_第1张图片
    下面讲2013年的那篇。Mikolov在2013年发表了两篇论文,一篇是continuous bag-of-words模型,另一篇是skip gram。还会讲一点 G l o V e GloVe GloVe,它的效果也很好。

gloveword2vec的思想是给定一个词,可以预测它的上下文(surrounding words),或相反。
Lec3.1 Word2vec_第2张图片
这种方法存在的一个前提是一个假设distributional hypothesis,一个词的意思由这个词周围的词决定,出现在相同的环境中的词有相同的意思。

在这种前提下,word2vecglove都会间接或直接用到co-occurrence matrix的概念。
Lec3.1 Word2vec_第3张图片

你可能感兴趣的:(深度学习,STAT,946:,Deep,Learning,笔记)