October 2018
Beginner to intermediate
676 pages
18h 30m
English
The following steps implement the required logic:
twod_embeddings = pickle.load(open('twod_embeddings','rb'))reverse_dictionary = pickle.load(open('word_reverse_dictionary','rb'))
plt.rcParams['axes.labelsize'] = 20plt.rcParams['axes.labelweight'] = 'bold'plt.rcParams['xtick.labelsize'] = 15plt.rcParams['ytick.labelsize'] = 15
fig, ax = plt.subplots(figsize=(20,20))
num_points = 400words = [reverse_dictionary[i] for i in range(1, num_points+1)]for i, label in enumerate(words): x, y = twod_embeddings[i,:] ax.scatter(x, y) ax.annotate(label, xy=(x, y), xytext=(5, 3), ...
Read now
Unlock full access