From a0ee1b0c1437ea175e21e2b5bc7593382fe0667c Mon Sep 17 00:00:00 2001 From: Gordon Mohr Date: Sat, 7 Dec 2019 23:16:35 -0800 Subject: [PATCH] update usages --- gensim/test/test_similarities.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gensim/test/test_similarities.py b/gensim/test/test_similarities.py index 9c0772641e..aa93d23cf9 100644 --- a/gensim/test/test_similarities.py +++ b/gensim/test/test_similarities.py @@ -547,7 +547,7 @@ def setUp(self): def testWord2Vec(self): model = word2vec.Word2Vec(texts, min_count=1) - model.init_sims() + model.wv.init_sims() index = self.indexer(model, 10) self.assertVectorIsSimilarToItself(model.wv, index) @@ -710,7 +710,7 @@ def setUp(self): def test_word2vec(self): model = word2vec.Word2Vec(texts, min_count=1) - model.init_sims() + model.wv.init_sims() index = self.indexer(model) self.assertVectorIsSimilarToItself(model.wv, index) @@ -729,11 +729,11 @@ def __iter__(self): yield line.lower().strip().split() model = FastText(LeeReader(datapath('lee.cor'))) - model.init_sims() + model.wv.init_sims() index = self.indexer(model) self.assertVectorIsSimilarToItself(model.wv, index) - self.assertApproxNeighborsMatchExact(model, model.wv, index) + self.assertApproxNeighborsMatchExact(model.wv, model.wv, index) self.assertIndexSaved(index) self.assertLoadedIndexEqual(index, model) @@ -801,7 +801,7 @@ def setUp(self): from gensim.similarities.nmslib import NmslibIndexer self.model = doc2vec.Doc2Vec(sentences, min_count=1) - self.model.init_sims() + self.model.docvecs.init_sims() self.index = NmslibIndexer(self.model) self.vector = self.model.docvecs.vectors_docs_norm[0]