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

_, tokens, dimensions, _ = glove_file.split('.') ValueError: too many values to unpack (expected 4) #9

Open
monajalal opened this issue Jul 3, 2019 · 2 comments

Comments

@monajalal
Copy link

When I change your code to read the twitter glove 200 dimension, I get the following error for Anaconda Python 3. How can I fix that?

glove_file="glove.twitter.27B.200d.txt"
_, tokens, dimensions, _ = glove_file.split('.')

Error is:

(base) tw-mbp-mjalal:glove mjalal$ python test.py 
Traceback (most recent call last):
  File "test.py", line 82, in <module>
    _, tokens, dimensions, _ = glove_file.split('.')
ValueError: too many values to unpack (expected 4)
@nabinkhadka
Copy link

@monajalal Remove the twitter part in the filename. So your filename should be glove.27B.200d.txt instead of glove.twitter.27B.200d.txt

@swamineha
Copy link

I am getting the following error:

File "C:\Users\NEHA\Anaconda\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 827, in runfile
execfile(filename, namespace)

File "C:\Users\NEHA\Anaconda\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 110, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)

File "C:/Users/NEHA/.spyder-py3/glove sim.py", line 83, in
prepend_slow(glove_file,gensim_file,gensim_first_line)

File "C:/Users/NEHA/.spyder-py3/glove sim.py", line 30, in prepend_slow
for line in fin:

File "C:\Users\NEHA\Anaconda\lib\encodings\cp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]

UnicodeDecodeError: 'charmap' codec can't decode byte 0x90 in position 962: character maps to

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