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

WordNet: Synsets' relations are absent from their corresponding lemmas #1970

Open
marcevrard opened this issue Mar 2, 2018 · 4 comments · May be fixed by #3231
Open

WordNet: Synsets' relations are absent from their corresponding lemmas #1970

marcevrard opened this issue Mar 2, 2018 · 4 comments · May be fixed by #3231
Assignees
Labels

Comments

@marcevrard
Copy link

marcevrard commented Mar 2, 2018

In WordNet, it seems to me that the relations relevant for a given synset should be relevant for its corresponding lemmas as well. In the nltk implementation, all semantic relations implemented as methods for synsets (e.g., hypernyms()) are indeed also available for lemmas. Though for example, the lemma trick.n.01.trick hypernyms method does not return anything, while its synset's does.

Using the lemma method:

>>> trick_lemma = wnt.get_synset('trick.n.01').lemmas()[0]
>>> print(trick_lemma.hypernyms())
[]

Using the the synset method instead:

>>> print(trick_lemma.synset().hypernyms())
[Synset('device.n.03')]
>>> print(trick_lemma.synset().hypernyms()[0].lemmas())
[Lemma('device.n.03.device'), Lemma('device.n.03.gimmick'), Lemma('device.n.03.twist')]

Expected behavior of the lemma method:

>>> print(trick_lemma.hypernyms())
[Lemma('device.n.03.device'), Lemma('device.n.03.gimmick'), Lemma('device.n.03.twist')]

Versions:

nltk 3.2.5
Python 3.6.4
Ubuntu 17.10
@marcevrard marcevrard changed the title Relations of a synset are not produced for its corresponding lemmas WordNet: Synsets' relations are absent for their corresponding lemmas Mar 2, 2018
@marcevrard marcevrard changed the title WordNet: Synsets' relations are absent for their corresponding lemmas WordNet: Synsets' relations are absent from their corresponding lemmas Mar 2, 2018
@ekaf
Copy link
Contributor

ekaf commented Jan 20, 2024

The docstring for the Lemma class still claims that lemmas can directly return the relations defined for their synset. However, this is not true in practice, and such calls only return an empty list.

It is true that anything that holds for a synset also holds for the lemmas included in that synset, so a user is free to interpret the synset relations as also holding for lemmas. However, since this can be achieved by simply obtaining the synset of the input lemma, it would be an unnecessary extension, which a generic WordNet interface does not need to include.

In the WordNet database, synset relations are not defined at the lemma level, and there would not be any practical advantage in blurring the distinction between synset and lemma relations.

So, in my opinion, the current practice is the most correct one. Then, the docstring of the Lemma class should probably be edited, to reflect that synset relations are not directly available at the lemma level, but need an intermediate call to synset().

@ekaf
Copy link
Contributor

ekaf commented Jan 23, 2024

On the other hand, most people probably think of hypernymy as a relation between words, rather than synsets. WordNet could be easier to use, and more widely accepted, if less knowledge of its peculiarities was required. So today I'm leaning more toward @marcevrard's viewpoint, and think that it could be advantageous to make synset relations directly accessible from the lemmas.

@ekaf ekaf self-assigned this Jan 29, 2024
@stevenbird
Copy link
Member

Sorry for not responding much earlier. I think the logic here is for programmers to be clear about the difference between lemmas and synsets. Lemmas are forms. Synsets are concepts. I would prefer us to fix the documentation.

@ekaf
Copy link
Contributor

ekaf commented Mar 12, 2024

Anyway, just editing the docstring would not be sufficient for fixing this issue. Currently, all the relations are defined at the level of the WordnetObject class, so the Lemma class inherits definitions for the hypernyms, hyponyms, etc..., and always returns an empty list for each call of these functions, as marcevrard notes.
Stricter adherence to WordNet's distinction between synset vs. lemma relations would involve moving the definitions of all the synset relations, from the WordnetObject class, to the Synset class.
Then, instead of returning an empty list, calling these functions on a lemma would raise an error:

AttributeError: 'Lemma' object has no attribute 'hypernyms'

On the other, according to this Wikipedia page , everybody else considers hyponymy to be a relation between words or terms:

In linguistics, semantics, general semantics, and ontologies, hyponymy (from Ancient Greek ὑπό (hupó) 'under', and ὄνυμα (ónuma) 'name') shows the relationship between a generic term (hypernym) and a specific instance of it (hyponym). A hyponym is a word or phrase whose semantic field is more specific than its hypernym.

So we cannot expect that programmers would want to learn a too strict interpretation of this distinction between synset and lemma relationships.

Furthermore, we need to adress the special case of the hybrid relations, which have both synset and lemma occurences in WordNet, but are not yet properly supported by NLTK's wordnet.py module.

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 a pull request may close this issue.

4 participants