I have created word vectors using a distributed word2vec algorithm. Now I have words and their corresponding vectors. How to build a gensim word2vec model using these words and vectors?
I am not sure if you created word2vec model using gensim or some other tools but if understand your question correctly you want to just load the word2vec model using gensim. This is done in the following way:
import gensim
w2v_file = codecs.open(WORD2VEC_PATH, encoding='utf-8')
model = gensim.models.KeyedVectors.load_word2vec_format(w2v_file, binary=True) # or binary=False if the model is not compressed
If, however, what you want to do is to train word2vec model from scratch (i.e. from raw text) using purely gensim here is a tutorial on how to train word2vec model using gensim.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With