From dfaa077ff5ab0cabab30e934c55b008bd9e7ddf6 Mon Sep 17 00:00:00 2001 From: Charles Sutton Date: Sun, 7 Aug 2016 16:04:07 +0300 Subject: [PATCH] print the document from test instead of train I have just corrected a small error, Now the document that should appears when printing is the one from the test corpus, Best regards, --- docs/notebooks/doc2vec-lee.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/notebooks/doc2vec-lee.ipynb b/docs/notebooks/doc2vec-lee.ipynb index 624df140ea..7d8cb1c96a 100644 --- a/docs/notebooks/doc2vec-lee.ipynb +++ b/docs/notebooks/doc2vec-lee.ipynb @@ -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)))"