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

Make WordNet's synset relations available from the lemmas #3231

Draft
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

ekaf
Copy link
Contributor

@ekaf ekaf commented Jan 30, 2024

Fix #1970: make WordNet's synset relations available from the lemmas.

from nltk.corpus import wordnet as wn
insect = wn.lemmas("insect")[0]
print(insect.hypernyms())

[Synset('arthropod.n.01')]

The in_topic_domain() relation ("-c") is hybrid, because a few lemmas have both lemma and synset targets. For ex:

print(insect.in_topic_domains())

[Lemma('chirpy.a.01.chirpy'), Synset('holometabolism.n.01')]

@ekaf ekaf marked this pull request as draft March 14, 2024 09:17
@ekaf
Copy link
Contributor Author

ekaf commented Mar 14, 2024

This needs more work in order to return the lemmas of the synset targets, as in the last example from this comment by @marcevrard.
Alternatively, depending on the consensus, the relation definitions could be moved from the WordnetObject class to the Synset class.

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

Successfully merging this pull request may close these issues.

WordNet: Synsets' relations are absent from their corresponding lemmas
1 participant