word2vec how to get words from vectors?

后端 未结 1 1843
一生所求
一生所求 2021-01-20 20:30

I use ANN to predict words from words. The input and output are all words vectors. I do not know how to get words from the output of ANN. By the way, it\'s gensim I am usin

相关标签:
1条回答
  • 2021-01-20 21:31

    You can find cosine similarity of the vector with all other word-vectors to find the nearest neighbors of your vector.

    The nearest neighbor search on an n-dimensional space, can be brute force, or you can use libraries like FLANN, Annoy, scikit-kdtree to do it more efficiently.

    update

    Sharing a gist demonstrating the same: https://gist.github.com/kampta/139f710ca91ed5fabaf9e6616d2c762b

    0 讨论(0)
提交回复
热议问题