Commit eeff1a73 authored by Anirudha Pimpale's avatar Anirudha Pimpale

checking left with 100 iter

parent cfb01eb5
......@@ -8,9 +8,11 @@ from gensim.models.doc2vec import Doc2Vec, TaggedDocument
def predict():
old_model = gensim.models.doc2vec.Doc2Vec.load('testModel.model')
tokens = "computer gaming is the best thing".split()
new_vector = d2v_model.infer_vector(tokens)
tokens = "alzheimer's".split()
new_vector = old_model.infer_vector(tokens)
print(old_model.docvecs.most_similar(new_vector))
print(old_model.most_similar([new_vector]))
print(old_model.docvecs.offset2doctag([new_vector]))
\ No newline at end of file
# print(old_model.docvecs.most_similar("ball"))
# print(old_model.most_similar([new_vector]))
# print(old_model.docvecs.offset2doctag([new_vector]))
print(old_model.docvecs.most_similar([new_vector]))
\ No newline at end of file
......@@ -50,7 +50,7 @@ def train():
model.build_vocab(dataset)
for epoch in range(100):
print('iteration'+str(epoch+1))
model.train(labels, epochs=model.iter, total_examples=model.corpus_count)
model.train(dataset, epochs=model.iter, total_examples=model.corpus_count)
model.alpha -= 0.002
model.min_alpha = model.alpha
model.save('testModel.model')
\ No newline at end of file
from lib import TrainCall
from lib import predictCall
import argparse
def main():
......
computer gaming is the best thing
\ No newline at end of file
No preview for this file type
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment