PrincetonML / SIF_mini_demo

minimal example for sentence embedding by Smooth Inverse Frequency weighting scheme
MIT License
35 stars 11 forks source link

Error when running demo #5

Open dzhao123 opened 5 years ago

dzhao123 commented 5 years ago

So I am trying to run the demo but there is an error report, can you give me some hints about it? Thanks.

Traceback (most recent call last):
  File "sif_embedding.py", line 13, in <module>
    (words, We) = data_io.getWordmap(wordfile)
  File "../src/data_io.py", line 18, in getWordmap
    v.append(float(i[j]))
ValueError: could not convert string to float: '.'
Cumberbatch08 commented 5 years ago

If you print the line , you will find that I word is not a simple word, it may be ‘...’ '@ google.com', you can add len(line) == 301 to assert.