Week 2 Quiz: Natural Language Processing and Word Embeddings (第二周测验:自然语言处理与词嵌入) 1.Suppose you learn a word embedding for a vocabulary of 10000 words. Then the embedding vectors should be 10000 dimensional, so as to capture the full range of variation…
参考 1. Word Representation 之前介绍用词汇表表示单词,使用one-hot 向量表示词,缺点:它使每个词孤立起来,使得算法对相关词的泛化能力不强. 从上图可以看出相似的单词分布距离较近,从而也证明了Word Embeddings能有效表征单词的关键特征. 2. 词嵌入(word embedding) Transfer learning and word embedding: 从海量词汇库中学习word embeddings(即所有单词的特征向量),或者从网上下载预训练好的w…
import numpy as np import matplotlib.pyplot as plt la = np.linalg words = ["I","like","enjoy","deep","learning","NLP","flying","."] X = np.array([[0,2,1,0,0,0,0,0], [2,0,0,1,0…