2

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.

T3J45
  • 717
  • 3
  • 12
  • 32
  • Related, please take a look at https://stackoverflow.com/questions/50009296/note-taking-program-with-nltk-and-wordnet-doesnt-work-error-message-says-its-be/50018894#50018894 – alvas Apr 30 '18 at 03:43
  • Wordnets indexed lemmas not words/ngrams =) – alvas Apr 30 '18 at 03:44
  • Interface to sentiwordnet http://www.nltk.org/howto/sentiwordnet.html – alvas Apr 30 '18 at 03:44
  • Hi @alvas, I have been at Interface sentiwordnet page, however doesn't really solve my problem. Besides, the StackOF question has many details, but none of them directly takes in a bigram as input and then results with their synonyms, is it not possible? and ('^_^) Didn't get the 2nd comment. any more help? please? – T3J45 Apr 30 '18 at 07:30
  • @alvas any light you can shed on ConceptNet in python? I read that might help too. – T3J45 Apr 30 '18 at 07:32

0 Answers0