Suppose for any word I want to access its IS-A parent value and HAS-A value then is it possible using any api?
How to programmatically access wordnet hierarchy?
5.2k views Asked by AudioBubble At
3
There are 3 answers
0
On
You can use commandline. The command is "wn book -hypen" to get the hypernyms of the noun book. For meronyms, use the command "wn book -meron". Also the -o option gives the synset offset. Here is the link for further information.
0
On
Shameless plug:
I'm writing a Scala library to access WordNet. While not all the similarity measures have been implemented, all the word senses and relations are available. I use it for my research so its in active development.
import com.github.mrmechko.swordnet._
SKey("book",SPos.Noun)
//> List(SKey("publication%1:10:00::"))
SKey("publication%1:10:00::").getRelation(SRelationType.hypernym) //Hypernyms
SKey("publication%1:10:00::").getRelation(SRelationType.hyponym) //Hyponyms etc
SWordNet is available on GitHub and Sonatype
You can use the python API of the Natural Language Toolkit. In Wordnet, the IS-A-relation is called hypernym (opposite: hyponym) and the HAS-A relation is called meronym (opposite: holonym).
I also found the NodeBox Linguistics API easier to use: