def test2(self):
topWords = self.getTopTfIdfTerms("Jerusalem")
for word in topWords:
#print word, idfIndex[word] if word in idfIndex else 1.5
try:
print self.model.most_similar(positive=[word], topn=10)
except:
print "word not in vocabulary"
#print model.accuracy(r"C:\Users\David\workspace\Wiki\gitWiki\questions-words.txt")
#model = word2vec.Word2Vec(sentences)
#model = word2vec.Word2Vec.load_word2vec_format("C:\Users\David\workspace\Wiki\gitWiki\text8-queen", binary=False)
#model = gensim.models.Word2Vec.load_word2vec_format('/tmp/vectors.txt', binary=False)
评论列表
文章目录