I am searching for the English thesaurus for all words we used id English to add to elastic search synonym list. Where can I get it?

Viewed 329

I want list of synonyms words for all English words..where can I get this? I need to add then in Elastic search synonym list to get more efficient results.

1 Answers

The most well-known thesaurus with English synonyms is WordNet.

If you want to access it from Python, you can use nltk for this purpose.

import nltk
nltk.download('wordnet')

from nltk.corpus import wordnet 
synset = wordnet.synsets("cake")
print('Synonyms: ' + '; '.join(sorted({lemma.name() for sense in synset for lemma in sense.lemmas()})))
# Synonyms: bar; cake; coat; patty
Related