I have downloaded pretrained glove vector file from the internet. It is a .txt file. I am unable to load and access it. It is easy to load and access a word vector binary file u
I suggest using gensim to do everything. You can read the file, and also benefit from having a lot of methods already implemented on this great package.
Suppose you generated GloVe vectors using the C++ program and that your "-save-file" parameter is "vectors". Glove executable will generate you two files, "vectors.bin" and "vectors.txt".
Use glove2word2vec to convert GloVe vectors in text format into the word2vec text format:
from gensim.scripts.glove2word2vec import glove2word2vec
glove2word2vec(glove_input_file="vectors.txt", word2vec_output_file="gensim_glove_vectors.txt")
Finally, read the word2vec txt to a gensim model using KeyedVectors:
from gensim.models.keyedvectors import KeyedVectors
glove_model = KeyedVectors.load_word2vec_format("gensim_glove_vectors.txt", binary=False)
Now you can use gensim word2vec methods (for example, similarity) as you'd like.