I am new to NLP, NLTK and Python. I am using wordnet to get the synonyms for a word in given sentence. I am using the below code to get the synonyms and lemma names of those words
synonyms = wordnet.synsets(w,pos)
lemmas.append(list( set(chain.from_iterable([w.lemma_names() for w in synonyms]))))
eg : wordnet.synsets("get",'v')
The lemma_names for this word "get" returns many things which are irrelevant for me.
My search string is "error getting the report". lemma_names has even "buzz off", "gets under one's skin" which are not correct for my statement.
So is there a way get synonyms which are relevant to the statement? is there any concept or algorithms that I can check for?