阅读大概需要16分钟 ![]()
跟随小博主,每天进步一丢丢 ![]()
作者:艾春辉
学校:华北电力大学、苏州大学准研究生
编辑:王萌(澳门城市大学)
wordNet的问题:?
步骤:
word2vec的一些参数:
为什么每个单词都需要训练两个词向量
两个模型变体
原始的论文中skip-gram模型是最大化的,这里给出:
课程中的公式:
我们希望中⼼词与真实上下⽂单词的向量点积更⼤,中⼼词与随机单词的点积更⼩
k是我们负采样的样本数⽬
共现矩阵 X
利⽤某个定⻓窗⼝中单词与单词同时出现的次数来产⽣window-based (word-word) co-occurrence matrix
let me to tell you a example: 句子
方法一: SVD分解
方法二: Ramped windows that count closer words more----将window倾斜向能统计更接近的单词中
方法三: 采用person相关系数
两种方法:
优点
缺点
优点
缺点
采用共现矩阵的思想对meaning进行编码
我们如何评判在线性表达下的共现矩阵相似度
结论
the problem:Most words have lots of meanings!(一词多义问题)• Especially common words • Especially words that have existed for a long time
method1: Improving Word Representations Via Global Context And Multiple Word Prototypes (Huang et al. 2012) -------将常⽤词的所有上下⽂进⾏聚类,通过该词得到⼀些清晰的簇,从⽽将这个常⽤词分解为多个单词,例如 bank_1, bank_2, bank_3
method2: Linear Algebraic Structure of Word Senses, with Applications to Polysemy (Arora, …, Ma, …, TACL 2018)
Different senses of a word reside in a linear superposition (weighted sum) in standard word embeddings like word2vec -----------采用加权和的形式进行处理
令人惊讶的是,这个加权均值的效果非常好
到目前我们学的为止,我们的目标是内在任务,强调开发一个特别优秀的word embedding。接下来我们讨论如何处理外部任务
Most NLP extrinsic tasks can be formulated as classification tasks. For instance, given a sentence, we can classify the sentence to have positive, negative or neutral sentiment. Similarly, in named-entity recognition (NER), given a context and a central word, we want to classify the central word to be one of many classes. ------许多nlp的task都可以归类为分类任务
for example:我们有一个句子: Jim bought 300 shares of Acme Corp. in 2006,我们的目标是得到一个结果:[Jim]Person bought 300 shares of [Acme Corp.]Organization in [2006]Time.
我们预训练的词向量在外部评估中的表现仍然有提高的可能,然而,如果我们选择重新训练,我们会存在很大的风险------可能效果会比之前差得多
If we retrain word vectors using the extrinsic task, we need to ensure that the training set is large enough to cover most words from the vocabulary. -----因为word2vec和glove会产生一些语义接近的单词,并且这些单词位于同一个单词空间。如果我们在一个小的数据集上预训练,这些单词可能在向量空间中移动,这会导致我们的结果更差
softmax的训练
我们通常的输入不是一个单词
Improving Distributional Similarity with Lessons Learned from Word Embeddings
Evaluation methods for unsupervised word embeddings
glove原文
下载一:中文版!学习TensorFlow、PyTorch、机器学习、深度学习和数据结构五件套!
后台回复【五件套】
下载二:南大模式识别PPT
后台回复【南大模式识别】
由于微信平台算法改版,公号内容将不再以时间排序展示,如果大家想第一时间看到我们的推送,强烈建议星标我们和给我们多点点【在看】。星标具体步骤为:
(1)点击页面最上方“深度学习自然语言处理”,进入公众号主页。
(2)点击右上角的小点点,在弹出页面点击“设为星标”,就可以啦。
感谢支持,比心。
投稿或交流学习,备注:昵称-学校(公司)-方向,进入DL&NLP交流群。
方向有很多:机器学习、深度学习,python,情感分析、意见挖掘、句法分析、机器翻译、人机对话、知识图谱、语音识别等。
记得备注呦
整理不易,还望给个在看!