为什么基于skip-gram的word2vec在低频词汇相比cbow更有效?

  统计/机器学习 自然语言处理 人工神经网络    浏览次数:6616        分享
3

面试题库里卷38里的一道题目

对于基于skip-gram和基于CBOW的word2vec,哪个模型对低频词汇表现更好?

答案是skip-gram

不是非常理解,求大神分析下

 

yayat   2018-08-11 23:27



   2个回答 
12

CBOW是根据上下文预测当中的一个词,也就是用多个词预测一个词

比如这样一个句子yesterday was really a [...] day,中间可能是good也可能是nice,比较生僻的词是delightful。当CBOW去预测中间的词的时候,它只会考虑模型最有可能出现的结果,比如goodnice,生僻词delightful就被忽略了。

而对于[...] was really a delightful day这样的句子,每个词在进入模型后,都相当于进行了均值处理(权值乘以节点),delightful本身因为生僻,出现得少,所以在进行加权平均后,也容易被忽视。

Skip-Gram是根据一个词预测它的上下文,也就是用一个词预测多个词,每个词都会被单独得训练,较少受其他高频的干扰。所以对于生僻词Skip-Gram的word2vec更占优。


SofaSofa数据科学社区DS面试题库 DS面经

mrhust   2018-09-24 08:55

6

在 Google Groups 中,Milokov 提到:

“Skip-gram: works well with small amount of the training data, represents well even rare words or phrases

CBOW: several times faster to train than the skip-gram, slightly better accuracy for the frequent words

This can get even a bit more complicated if you consider that there are two different ways how to train the models: the normalized hierarchical softmax, and the un-normalized negative sampling. Both work quite differently.”


关于这段话,stackoverflow 就数据量这个问题进行过讨论:https://stackoverflow.com/questions/39224236/word2vec-cbow-skip-gram-performance-wrt-training-dataset-size


但关于低频词汇的有效性,并没有过多的说明,我是这样反向理解的:由于 CBOW 需要更多的数据,所以它对高频词汇更敏感,从而在低频词汇上表现没有 skip-gram 好。


觉得这样解释不是很好,欢迎补充!

SofaSofa数据科学社区DS面试题库 DS面经

lpq29743   2018-09-08 21:18



  相关讨论

gensim训练出的Word2Vec模型每次都不一样

word2vec的网络里为什么没有bias偏置项

gensim里word2vec的window指的是什么?包括的范围是多大?

gensim的word2vec模型是skip-gram还是cbow?

教程中的利用Word2Vec判断是否是白话

怎么把训练好的bin格式的word2vec模型导入到gensim中使用?

gensim.models.word2vec模块的LineSentence有什么用?

word2vec怎么处理一词多义的情况?

如果不去除stop words,word2vec的结果会受到影响吗?

训练word2vec时移动窗口的大小怎么选择?

  随便看看

自助法(bootstrap)的0.632是怎么来的?

'str' object has no attribute 'decode' 代码运行时有错误呢?请高手帮忙解决

怎么把pandas dataframe中的一列转成一个list?

sklearn分类模型中预测结果怎么调整概率的阈值

怎么提取pandas dataframe中某一列每个字符串的前n个字符?