简体   繁体   中英

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM