Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is a check for numeric type needed in getWordmap method? #19

Open
314rated opened this issue Dec 16, 2017 · 2 comments
Open

Is a check for numeric type needed in getWordmap method? #19

314rated opened this issue Dec 16, 2017 · 2 comments

Comments

@314rated
Copy link

I am getting the following error:
File "sif_embedding.py", line 13, in
(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: '.'

Is it a bug or do we always expect numerical data for the line v.append(float(i[j]))?

@Dobatymo
Copy link

Dobatymo commented Mar 19, 2018

It's a bug (or at least a compatibility issue).
It should be .split(" ") in data_io.getWordmap() instead of .split() as this will prevent splitting on non-breaking spaces (which is the case here for glove.840B.300d.txt)

@Cumberbatch08
Copy link

the default character is ' ', I think it need to assert the length of line.
some word has ' '.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants