gensim word2vec accessing in/out vectors

后端 未结 4 707
一个人的身影
一个人的身影 2021-02-07 09:02

In the word2vec model, there are two linear transforms that take a word in vocab space to a hidden layer (the \"in\" vector), and then back to the vocab space (the \"out\" vecto

4条回答
  •  面向向阳花
    2021-02-07 09:21

    To get the syn1 of any word, this might work.

    model.syn1[model.wv.vocab['potato'].point]
    

    where model is your trained word2vec model.

提交回复
热议问题