WordNet is great, but I\'m having a hard time getting synonyms in nltk. If you search similar to for the word \'small\' like here, it shows all of the synonyms.
Ba
I've code Thesaurus Lookup for Synonym recently, I used this function :
def find_synonyms(keyword) :
synonyms = []
for synset in wordnet.synsets(keyword):
for lemma in synset.lemmas():
synonyms.append(lemma.name())
return str(synonyms)
But if you prefer to host your own Dictionary, you might interested with my project on offline synonym dictionary lookup on my github page :
https://github.com/syauqiex/offline_english_synonym_dictionary