November 2018
Beginner to intermediate
182 pages
4h 48m
English
We just downloaded these.
The file formats used by word2vec and GloVe are slightly different from each other. We'd like a consistent API to look up any word embedding, and we can do this by converting the embedding format. Note that there are minor differences in how word embedding is stored.
This format conversion can be done using Gensim's API called glove2word2vec. We will use this to convert our GloVe embedding information to the word2vec format.
So, let's get the imports out of the way and begin by setting up filenames, as follows:
from gensim.scripts.glove2word2vec import glove2word2vec
glove_input_file = 'data/glove.6B.300d.txt'
word2vec_output_file = 'data/glove.6B.300d.word2vec.txt'We don't ...
Read now
Unlock full access