Bahman Rouhani
Bahman Rouhani

Reputation: 1259

remove synonym words from text using nltk

so this might be a bit of an amateur question but is there a way to remove synonym words from a text (or a list for that matter) using nltk?
by synonym I also mean same words written differently like :
70's and 70s and 70_s
or dog and hound
I would really appreciate some general guide lines or pointing me to a tutorial (which I could not find any).
thanks in advance

Upvotes: 1

Views: 1105

Answers (1)

Bahman Rouhani
Bahman Rouhani

Reputation: 1259

I managed to delete duplicate items using wordnet.synsets to get the synonyms and then just iterated through the list to remove duplicates. I'm sure there are more sophisticated methods than iterating through the list but it worked just fine for me.

Upvotes: 2

Related Questions