title: Using SVD to plot word vector to measure similarity
body: <p>This is the code I am using to calculate a word co-occurrence matrix for immediate neighbor counts. I found the following code on the net, which uses SVD. </p>
  
  <pre><code> import numpy as np
   la = np.linalg
   words = ['I','like','enjoying','deep','learning','NLP','flying','.']
   ### A Co-occurence matrix which counts how many times the word before and after a particular word appears ( ie, like appears after I 2 times)
   arr = np.array([[0,2,1,0,0,0,0,0],[2,0,0,1,0,1,0,0],[1,0,0,0,0,0,1,0],[0,0,0,1,0,0,0,1],[0,1,0,0,0,0,0,1],[0,0,1,0,0,0,0,8],[0,2,1,0,0,0,0,0],[0,0,1,1,1,0,0,0]])
   u, s, v = la.svd(arr, full_matrices=False)
   import matplotlib.pyplot as plt
   for i in xrange(len(words)):
       plt.text(u[i,2], u[i,3], words[i])
  </code></pre>
  
  <p>In the last line of code, the first element of U is used as an x-coordinate and the second element of U is used as a y-coordinate to project the words, to see the similarity. <em>What is the intuition behind this approach?</em> Why they are taking the 1st and 2nd elements in each row (each row represents each word) as x and y to represent a word? Please help.    </p>