Here is the explanation of the preceding code:
- twod_embeddings = pickle.load(open('twod_embeddings','rb')) loads two-dimensional word representations. As explained earlier, pickle is the Python package to save and retrieve files in binary format. We are loading the data from the twod_embeddings file, and 'rb' represents read in binary format.
- reverse_dictionary = pickle.load(open('word_reverse_dictionary','rb')) loads the word dictionary that is used to map numbers to corresponding textual words, which will be displayed on the plot.
- plt.rcParams['axes.labelsize'] = 20 sets the x and y axes labelsize.
- plt.rcParams['axes.labelweight'] = 'bold' sets the x and y labelweight.
- plt.rcParams['xtick.labelsize'] = 15 sets the x-axis ...