How to Plot Word Embeddings trained in the "Word Embeddings: Encoding Lexical Semantics" Tutorial

Been new to pytorch I have completed “Word Embeddings: Encoding Lexical Semantics” tutorial and also the exercise. However, I cannot find a good way to plot the Embeddings after the model is trained.

Please Suggest a good way to do it.

Thanks in advance. :slight_smile:

You can extract the embedding weights using model.embeddings.weight. Using word2idx dictionary, you can retrieve embedding vector for each word. However, those are likely in high dimensional space. To visualize, choose your favorite dimension reduction technique, e.g. tSNE. :slight_smile:

1 Like

Try extracting the features of words and save them in tsv format. Then try using to visualize them!

1 Like