IKH

WordNet- Code Demo

In the previous segment, you gained an understanding of word senses, synsets and relations between word senses in WordNet. In this segment, you will learn how to use the NLTK library to parse the graph in WordNet.

You can download the files from the github link. Refer README.md in the link for proper instructions for downloading the files.

Put on your coding hats and let’s get started.

You learnt how to get the synsets of a word and the definition of each sense of the word. 

Source

We started from the tractor and traversed the graph upwards using the hypernyms function in WordNet until we reached the wheeled vehicle. 

Then, we used the meronyms function to traverse the ‘has part’ relation.

Now that you learnt how to traverse up the graph, in the next video, let’s try to traverse down the graph.

We can traverse the graph downwards using the hyponyms function. 

Please note that all the hyponyms of a particular word are not shown in the graph.

Let’s consider the example given below.

You also learnt how to use the NLTK library to traverse the WordNet graph and understood the different relations in WordNet. In the next segment, you will learn how to apply these functions for Word sense disambiguation.

Report an error