Getting Word Embeddings For Your Dataset Using Training Data In Glove
I recently installed gensim and glove in my mac and am trying to get word embedding for textual data I have. However, I'm having trouble finding the right function for it. I've onl
Solution 1:
Actually, the format of glove is different from word2vec you can convert the format of glove to word2vec format using this https://radimrehurek.com/gensim/scripts/glove2word2vec.html
Let the converted glove is glove_changed.txt
import gensim
model = gensim.models.KeyedVectors.load_word2vec_format('glove_changed.txt', binary=False)
print(model['cat']) // This will give the wordvector for the word 'cat'
Post a Comment for "Getting Word Embeddings For Your Dataset Using Training Data In Glove"