I am trying to get sentiwordnet scores for a project in python and I find this code somewhere.
import sentiwordnet
from sentiwordnet import *
swn_filename = 'C:\\Python27\\Lib\\SentiWordNet_3.0.0_20130122.txt'
swn = SentiWordNetCorpusReader(swn_filename)
and so on... However, when I run it throws error "no module named sentiwordnet". I tried to pip install sentiwordnet thinking the module might be missing but that also threw an error. What to do?? Pls help.
Check out the installation guide here: http://www.nltk.org/install.html
The class you want to use is documented here: http://www.nltk.org/api/nltk.corpus.reader.html#module-nltk.corpus.reader.sentiwordnet