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 found this approach faster.
import pandas as pd df = pd.read_csv('glove.840B.300d.txt', sep=" ", quoting=3, header=None, index_col=0) glove = {key: val.values for key, val in df.T.items()}
Save the dictionary:
import pickle with open('glove.840B.300d.pkl', 'wb') as fp: pickle.dump(glove, fp)