If I have a list of words in python such as:
words = ["blue", "red", "ball"]
Is there a way to programmatically produce the hypernyms for this group of words using WordNet?
If I have a list of words in python such as:
words = ["blue", "red", "ball"]
Is there a way to programmatically produce the hypernyms for this group of words using WordNet?
Copyright © 2021 Jogjafile Inc.
Firstly, see https://stackoverflow.com/a/29478711/610569 to note the difference between "sense" (synset/concept) vs "words" (in the context of wordnet, lemmas).
Given two synsets (NOT words), it is possible to find the lowest common hypernym between them:
See http://www.nltk.org/howto/wordnet_lch.html
Is lowest common hypernyms reliable?
Wordnet is a hand-crafted resource, so how reliable it depends on why and how the synset was created among the whole WordNet ontology
Can I use this information for my NLP task?
Perhaps... But most probably, it's not useful.
Can it compare more than 2 synsets?
Not exactly. You have to do multiple pairwise search, e.g.
But you can see how inefficient it is. So it's easier if you rewrite your own code to traverse the WordNet ontology and find the lowest common hypernym given N no. of synsets instead of doing it pairwise.