COMP9444 Neural Networks and Deep Learning
Term 3, 2020
Exercises 6: Word Vectors
-
Consider the sentence
"two flowers grew tall on two tall towers"
- Write the co-occurrence matrix X for this sentence,
using a 4-word context window
(i.e. two context words on either side of the central word)
-
Use
torch.svd()
to compute the singular value decompositon
of this matrix X = USVT
- Extract a word representation from the first two columns of U
and use
matplotlib
to plot the words on a 2-dimensional graph.