attardi / deepnl

Deep Learning for Natural Language Processing
GNU General Public License v3.0
458 stars 116 forks source link

Problem while running dl-sentiwords.py #36

Closed wikiban43 closed 8 years ago

wikiban43 commented 8 years ago

Hi,

I have created a word embedding file using Gensim, and am using the word2vec option while running dl-sentiwords.py. I am doing:

python dl-sentiwords.py training.tsv --vocab vocab.txt --vectors wiki2.text.vector --variant word2vec

However, it shows a zero-division error while running. The message is as follows:

Adding 2 special symbols Saving vocabulary in vocab.txt Creating new network... ... with the following parameters:

    Input layer size: 4400
    Hidden layer size: 200
    Output size: 2

Starting training Traceback (most recent call last): File "dl-sentiwords.py", line 217, in trainer.train(converted_sentences,reader.polarities,trie,args.iterations,report_intervals) File "deepnl/sentiwords.pyx", line 288, in deepnl.sentiwords.SentimentTrainer.train (deepnl/sentiwords.cpp:6437) ZeroDivisionError: float division

I tried to see the corresponding line (line 288 in sentiwords.pyx). However, I am not sure which parameter is obtaining a zero value resulting in this error. Could you please point me towards the possible reasons because of which this issue might occur?

Thanks

wikiban43 commented 8 years ago

Sorry for the trouble. I resolved the issue myself. My training.tsv file was not tab delimited. That was the reason "reader.sentences" was getting an empty list.