WordNet is an English dictionary which is a part of Natural Language Tool Kit (NLTK) for Python. This is an extensive library built to make Natural Language Processing (NLP) easy. Some basic functions will be discussed in this article. To start using WordNet, you have to import it first: from nltk.corpus import wordnet Synsets and Lemmas In WordNet, similar words are grouped into a set known as a Synset (short for Synonym-set ). Every Synset has a name, a part-of-speech, and a number. The words in a Synset are known as Lemmas . Getting Synsets The function wordnet.synsets('word') returns an array containing all the Synsets related to the word passed to it as the argument. Example: print ( wordnet.sysnets ( 'room' )) Output: [Synset(‘room.n.01’), Synset(‘room.n.02’), Synset(‘room.n.03’), Synset(‘room.n.04’), Synset(‘board.v.02’)] The method returned five Synsets; four have the name...
Comments
Post a Comment