title: What is the operation behind the word analogy in Word2vec?
body: <p>According to <a href="https://code.google.com/archive/p/word2vec/" rel="noreferrer">https://code.google.com/archive/p/word2vec/</a>: </p>
  
  <blockquote>
    <p>It was recently shown that the word vectors capture many linguistic
    regularities, for example vector operations vector('Paris') -
    vector('France') + vector('Italy') results in a vector that is very
    close to vector('Rome'), and vector('king') - vector('man') +
    vector('woman') is close to vector('queen') [3, 1]. You can try out a
    simple demo by running demo-analogy.sh.</p>
  </blockquote>
  
  <p>So we can try from the supplied demo script:</p>
  
  <pre><code>+ ../bin/word-analogy ../data/text8-vector.bin
  Enter three words (EXIT to break): paris france berlin
  
  Word: paris  Position in vocabulary: 198365
  
  Word: france  Position in vocabulary: 225534
  
  Word: berlin  Position in vocabulary: 380477
  
                                                Word              Distance
  ------------------------------------------------------------------------
                                             germany      0.509434
                                            european      0.486505
  </code></pre>
  
  <p>Please note that <code>paris france berlin</code> is the input hint the demo suggest. The problem is that I'm unable to reproduce this behavior if I open the same word vectors in <code>Gensim</code> and try to compute the vectors myself. For example:</p>
  
  <pre><code>&gt;&gt;&gt; word_vectors = KeyedVectors.load_word2vec_format(BIGDATA, binary=True)
  &gt;&gt;&gt; v = word_vectors['paris'] - word_vectors['france'] + word_vectors['berlin']
  &gt;&gt;&gt; word_vectors.most_similar(np.array([v]))
  [('berlin', 0.7331711649894714), ('paris', 0.6669869422912598), ('kunst', 0.4056406617164612), ('inca', 0.4025722146034241), ('dubai', 0.3934606909751892), ('natalie_portman', 0.3909246325492859), ('joel', 0.3843030333518982), ('lil_kim', 0.3784593939781189), ('heidi', 0.3782389461994171), ('diy', 0.3767407238483429)]
  </code></pre>
  
  <p>So, what is the word analogy actually doing? How should I reproduce it?</p>