Is it possible for the python library NLTK to suggest/create synonyms for groups of words?
For example; for the word/group "main course" can I use NLTK to get the synonyms "main dish", "main meal", "dinner" etc.?
Heres my code that works for single word synonyms but not multiwords:
from nltk.corpus import wordnet as wn
print wn.synset("eat.v.01").lemma_names # prints synonyms of eat
print wn.synset("main course.n.01").lemma_names # throws WordNetError
Use an underscore:
print wn.synset("main_course.n.01").lemma_names
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With