I've been trying
on how to get synonyms for the words I pass. That's an easy piece of cake for wordnet to do. However I'm trying and failing with bigrams
viz. 'i tried', 'horrible food', 'people go'
I looked for these
to learn more on sentiwordnet, since I read documentation. Perhaps, there are no examples on how to use it.
Went on for source too, yet I'm here.
I wrote
the code for doing it in foll. way, point out what needs correction:
from nltk.corpus import sentiwordnet as swn
sentisynset = swn.senti_synset('so horrible')
print(sentisynset)
Well, this clear returns ValeError
, not sure why though.
Also, I tried this:
from nltk.corpus.reader.lin import LinThesaurusCorpusReader as ltcr
synon = ltcr.synonyms(ngram='so horrible')
print(synon)
and this returns TypeError
, asking me for self
parameter to be filled.