In Chapter 7, Embedding Text and Expressions, we learned how to plot word embeddings in 2D space. Here, we will learn how to plot the same word embeddings in 3D space. To create the required data, we will have to run t-SNE algorithm with three components to generate x, y, and z coordinates. We will use this output to plot the graph.
Word embeddings
Getting ready
Import the required libraries:
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
import pickle
How to do it...
Here are the steps involved in plotting a word embeddings graph:
- Load the required...