title: How to extract matrix together with vocab from gensim word2vec model
body: <p>I've trained a word2vec model like so</p>
  <pre><code>from gensim.models import Word2Vec
  
  # create model without initializing
  model = Word2Vec(min_count=20,
                   window=5,
                   sample=6e-5, 
                   negative=20,
                   workers=cores-1,
                   vector_size=300)
  
  # build vocabulary
  w2v_model.build_vocab(sentences, progress_per=10000)
  
  # train model
  model.train(sentences, total_examples=w2v_model.corpus_count, epochs=30, report_delay=1)
  
  </code></pre>
  <p>I'd like to export the model as a dataframe, but not sure how to extract the matrix and vocab together correctly, with the right index positions.</p>
  <p>Something like this:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>label</th>
  <th>V1</th>
  <th>V2</th>
  <th>V...</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>government</td>
  <td>0.560774564</td>
  <td>-0.0464625023</td>
  <td>...</td>
  </tr>
  <tr>
  <td>state</td>
  <td>0.0106112240</td>
  <td>0.0464625023</td>
  <td>...</td>
  </tr>
  <tr>
  <td>....</td>
  <td>...</td>
  <td>..</td>
  <td>.</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>I've tried this:</p>
  <pre><code>tmp = pd.DataFrame(model.syn1neg)
  tmp.insert(0, 'label', model.wv.index_to_key)
  </code></pre>
  <p>which does not square up when comparing</p>
  <pre><code>&gt;&gt;&gt; model.wv.get_index('government')
  10
  &gt;&gt;&gt; tmp.loc[[0]]
  0 government 0.329972  0.160003 -0.516633  ...  0.460873 -0.170273 -1.621128  1.255289
  </code></pre>