I am studying the word2vec and GloVe model in python, so I am looking at this one available here .
After I compiled these codes step by step in Idle3:
>>>from gensim.models import word2vec >>>import logging >>>logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO) >>>sentences = word2vec.Text8Corpus('text8') >>>model = word2vec.Word2Vec(sentences, size=200)
I get this error:
2017-01-13 11:15:41,471 : INFO : collecting all words and their counts Traceback (most recent call last): File "<pyshell#4>", line 1, in <module> model = word2vec.Word2Vec(sentences, size=200) File "/usr/local/lib/python3.5/dist-packages/gensim/models/word2vec.py", line 469, in __init__ self.build_vocab(sentences, trim_rule=trim_rule) File "/usr/local/lib/python3.5/dist-packages/gensim/models/word2vec.py", line 533, in build_vocab self.scan_vocab(sentences, progress_per=progress_per, trim_rule=trim_rule)
How to fix this? Thanks in advance for your help.
user7399214
source share