Closed AlexSun1995 closed 6 years ago
如果分词的结果在WV的模型库中不存在, 返回的结果是全0的向量
try: c.append(_vectors.word_vec(y_)) except KeyError as error: print("not exist in w2v model: %s" % y_) c.append(np.zeros((100,), dtype=float))
如果待比较的两个词在模型库中都不存在,返回的结果都会是同样的向量, 二者之间的距离就会很近.而事实上二者之间的关系可能并不大
可以考虑返回随机向量(以token 的hashcode为seed)
git rev-parse HEAD
这个想法很好,能帮忙做一个PR么?
好的
description
如果分词的结果在WV的模型库中不存在, 返回的结果是全0的向量
current
expected
如果待比较的两个词在模型库中都不存在,返回的结果都会是同样的向量, 二者之间的距离就会很近.而事实上二者之间的关系可能并不大
solution
可以考虑返回随机向量(以token 的hashcode为seed)
environment
git rev-parse HEAD
) de23685fd7f1083ebea9f0354eeec0e82d89b543