Skip to content

Commit

Permalink
Doc2vec lee notebook bugfix: print the document from test instead of …
Browse files Browse the repository at this point in the history
…train (#816)
  • Loading branch information
charlessutton authored and tmylk committed Aug 14, 2016
1 parent 15ee57f commit e3ee122
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/notebooks/doc2vec-lee.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@
"sims = model.docvecs.most_similar([inferred_vector], topn=len(model.docvecs))\n",
"\n",
"# Compare and print the most/median/least similar documents from the train corpus\n",
"print('Test Document ({}): «{}»\\n'.format(doc_id, ' '.join(train_corpus[doc_id].words)))\n",
"print('Test Document ({}): «{}»\\n'.format(doc_id, ' '.join(test_corpus[doc_id])))\n",
"print(u'SIMILAR/DISSIMILAR DOCS PER MODEL %s:\\n' % model)\n",
"for label, index in [('MOST', 0), ('MEDIAN', len(sims)//2), ('LEAST', len(sims) - 1)]:\n",
" print(u'%s %s: «%s»\\n' % (label, sims[index], ' '.join(train_corpus[sims[index][0]].words)))"
Expand Down

0 comments on commit e3ee122

Please sign in to comment.