I have install gensim from this link
Corpora and Vectors are working well. But When I am working with word2vec then it gives this type of error
model = Word2Vec(sentences, size=100, window=5, min_count=5, workers=4)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'Word2Vec' is not defined
But when I am executing this command
>>> # import modules and set up logging
>>> from gensim.models import word2vec
>>> import logging
>>> logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO)
>>> sentences = word2vec.Text8Corpus('/tmp/text8')
>>> # train the skip-gram model; default window=5
>>> model = word2vec.Word2Vec(sentences, size=200)
>>> # ... and some hours later... just as advertised...
>>> model.most_similar(positive=['woman', 'king'], negative=['man'], topn=1)
[('queen', 0.5359965)]
then it gives correct ans.
How to resolve NameError: name 'Word2Vec' is not defined Problem