Get weight matrices from gensim word2Vec

I am using the gensim word2vec package in python. I would like to get the weight matrices W and W' , which were studied during training in the transmission method.

It seems to me that model.syn0 gives me the first, but I'm not sure how I can get another. Any idea?

I would really like to find comprehensive documentation on the available model attributes, because the official one does not seem accurate (for example, syn0 is not described as an attribute)

+7
python machine-learning nlp gensim word2vec
source share
1 answer

model.wv.syn0 contains an input input matrix. Embedding output is stored in model.syn1 when it is training with hierarchical softmax ( hs=1 ) or in model.syn1neg when it uses negative sampling ( negative>0 ). It! When both hierarchical softmax and negative sampling are not included, Word2Vec uses the unified weight matrix model.wv.syn0 for training.

See also the relevant discussion here .

+2
source share

All Articles