FastText嵌入的相似性很差

时间:2018-09-26 16:34:49

标签: nlp named-entity-recognition word-embedding fasttext ner

我正在尝试使用fastTest python包装器和英语模型文件(.bin)来获取单词嵌入并捕获它们之间的相似性,但是结果不如预期的那样。

使用加载模型后

model = ft.load_model('data/wiki.en.bin')

我正在尝试以此方式评估不同单词对之间的余弦相似度:

v1 = model.get_word_vector(str(word1))
v2 = model.get_word_vector(str(word2))

sim = np.dot(v1, v2) / (np.linalg.norm(v1) * np.linalg.norm(v2))

但是即使我输入了两个非常相似的词(例如“ person / people”或“ dog / animal”),两个结果的CS都小于0.1,结果还是很糟糕的。

有什么我想念的吗?

在此先感谢任何尝试给我提示的人

0 个答案:

没有答案