# loading glove data file # URL to donwload the GloVe embedding: https://nlp.stanford.edu/projects/glove/ D = 50 glove_data_file = f'data/glove.6B.{D}d.txt' words = pd.read_csv(glove_data_file, sep=" ", index_col=0, header=None, quoting=csv.QUOTE_NONE) # creating a dictionary for accessing words quickly words_dict = {word: embed for word, embed in zip(words.index, words.values.tolist())} print(f'Loaded {len(words_dict.keys())} words from the GloVe file')