October 2018
Beginner to intermediate
676 pages
18h 30m
English
Here are the steps involved in plotting a word embeddings graph:
threed_embeddings = pickle.load(open('threed_embeddings','rb'))reverse_dictionary = pickle.load(open('word_reverse_dictionary', 'rb'))
fig = plt.figure(figsize=(20,20))ax = fig.gca(projection='3d')
num_points = 400words = [reverse_dictionary[i] for i in range(1, num_points+1)]for i, label in enumerate(words): x, y, z = threed_embeddings[i,:] ax.scatter(x, y, z) ax.text(x, y, z, label, ha='right', va='bottom')
ax.set_xlim(-800,400)ax.set_ylim(-200,800) ...
Read now
Unlock full access