Back

Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
in Python by (12.7k points)
WordNet is incredible, however, I'm struggling to get equivalents in nltk. On the off chance that you search like for the word 'small' like here, it shows the entirety of the equivalents.

Fundamentally I simply need to know the accompanying: wn.synsets('word')[i].option() Where choice can be hypernyms and antonyms, however, what is the choice for getting equivalent words?

1 Answer

0 votes
by (26.4k points)

On the off chance that you need the equivalents in the synset (otherwise known as the lemmas that make up the set), you can get them with lemma_names():

>>> for ss in wn.synsets('small'):

>>>     print(ss.name(), ss.lemma_names())

small.n.01 ['small']

small.n.02 ['small']

small.a.01 ['small', 'little']

minor.s.10 ['minor', 'modest', 'small', 'small-scale', 'pocket-size',  'pocket-sized']

little.s.03 ['little', 'small']

small.s.04 ['small']

humble.s.01 ['humble', 'low', 'lowly', 'modest', 'small']    

...

Want to become an expert in Python? Join the python course fast!

To know more about this you can have a look at the following video tutorial:-

Related questions

0 votes
1 answer
0 votes
1 answer
asked Feb 19, 2021 in Python by laddulakshana (12.7k points)
0 votes
1 answer
0 votes
1 answer

Browse Categories

...