You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
KeyError Traceback (most recent call last)
Cell In [18], line 1
----> 1 synset.relations()
File ~/Projects/wikidrill/venv/lib/python3.9/site-packages/wn/_core.py:662, in Synset.relations(self, *args)
641 """Return a mapping of relation names to lists of synsets.
642
643 One or more relation names may be given as positional
(...)
659
660 """
661 d: Dict[str, List['Synset']] = {}
--> 662 for relname, ss in self._get_relations(args):
663 if relname in d:
664 d[relname].append(ss)
File ~/Projects/wikidrill/venv/lib/python3.9/site-packages/wn/_core.py:713, in Synset._get_relations(self, args)
711 rel_type, ili = rel_row[0], rel_row[4]
712 if ili is not None:
--> 713 relations[rel_type].add(ili)
715 # map back to target lexicons
716 seen = {ss._id for _, ss in targets}
KeyError: 'hypernym'
Same applies to the example from the docstring of relations methods
The text was updated successfully, but these errors were encountered:
Hi! I'm trying to collect a dataset of relations between words in the engilsh WordNet.
However when I run the following code
KeyError Traceback (most recent call last)
Cell In [18], line 1
----> 1 synset.relations()
File ~/Projects/wikidrill/venv/lib/python3.9/site-packages/wn/_core.py:662, in Synset.relations(self, *args)
641 """Return a mapping of relation names to lists of synsets.
642
643 One or more relation names may be given as positional
(...)
659
660 """
661 d: Dict[str, List['Synset']] = {}
--> 662 for relname, ss in self._get_relations(args):
663 if relname in d:
664 d[relname].append(ss)
File ~/Projects/wikidrill/venv/lib/python3.9/site-packages/wn/_core.py:713, in Synset._get_relations(self, args)
711 rel_type, ili = rel_row[0], rel_row[4]
712 if ili is not None:
--> 713 relations[rel_type].add(ili)
715 # map back to target lexicons
716 seen = {ss._id for _, ss in targets}
KeyError: 'hypernym'
The text was updated successfully, but these errors were encountered: