adhoc.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:workspace 作者: nojima 项目源码 文件源码
def find_similar_words_by_vector(self, vector: np.ndarray, n: int = 10):
        vocabulary = self._vocabulary
        similar_ids = sorted(range(0, vocabulary.size),
                             key=lambda id: cosine(self._vectors[id], vector))[:n]
        return [vocabulary.to_word(id) for id in similar_ids]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号