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

simple_lesk bug #57

Open
r-reilly opened this issue Aug 30, 2019 · 1 comment
Open

simple_lesk bug #57

r-reilly opened this issue Aug 30, 2019 · 1 comment

Comments

@r-reilly
Copy link

r-reilly commented Aug 30, 2019

When running from pywsd.lesk import cached_signatures, simple_lesk

I get the following error

Warming up PyWSD (takes ~10 secs)... Traceback (most recent call last):
File "/Users/rreilly/anaconda3/envs/-/lib/python3.7/site-packages/pandas/core/indexes/base.py", line 2897, in get_loc
return self._engine.get_loc(key)
File "pandas/_libs/index.pyx", line 107, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/index.pyx", line 131, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/hashtable_class_helper.pxi", line 1607, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas/_libs/hashtable_class_helper.pxi", line 1614, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'bar.n.04'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "", line 1, in
File "/Users/rreilly/anaconda3/envs/-/lib/python3.7/site-packages/pywsd/init.py", line 33, in
pywsd.lesk.simple_lesk('This is a foo bar sentence', 'bar')
File "/Users/rreilly/anaconda3/envs/-/lib/python3.7/site-packages/pywsd/lesk.py", line 251, in simple_lesk
from_cache=from_cache)
File "/Users/rreilly/anaconda3/envs/-/lib/python3.7/site-packages/pywsd/lesk.py", line 226, in simple_signatures
from_cache=from_cache)
File "/Users/rreilly/anaconda3/envs/-/lib/python3.7/site-packages/pywsd/lesk.py", line 123, in signatures
from_cache=from_cache)
File "/Users/rreilly/anaconda3/envs/-/lib/python3.7/site-packages/pywsd/lesk.py", line 48, in synset_signatures
return synset_signatures_from_cache(ss, hyperhypo, adapted, original_lesk)
File "/Users/rreilly/anaconda3/envs/-/lib/python3.7/site-packages/pywsd/lesk.py", line 35, in synset_signatures_from_cache
return cached_signatures[ss.name()][signature_type]
File "/Users/rreilly/anaconda3/envs/-/lib/python3.7/site-packages/pandas/core/frame.py", line 2980, in getitem
indexer = self.columns.get_loc(key)
File "/Users/rreilly/anaconda3/envs/-/lib/python3.7/site-packages/pandas/core/indexes/base.py", line 2899, in get_loc
return self._engine.get_loc(self._maybe_cast_indexer(key))
File "pandas/_libs/index.pyx", line 107, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/index.pyx", line 131, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/hashtable_class_helper.pxi", line 1607, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas/_libs/hashtable_class_helper.pxi", line 1614, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'bar.n.04'

@alvations
Copy link
Owner

@r-reilly seemed like the synset signatures were off when the wn packaged was updated. Could you try upgrading pip install -U pywsd then try again? It should work now =)

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

No branches or pull requests

2 participants