VADER-Sentiment-Analysis toolkit and decoding to UTF-8

384 Views Asked by At

I'm trying out this awesome sentiment analysis toolkit for python called Vader (https://github.com/cjhutto/vaderSentiment#python-code-example). However, I'm not even able to run their examples, because of a decoding problem (?).

I've tried the .decode('utf-8'), but it still gives me this error code:

Traceback (most recent call last):
  File "/Users/solari/Codes/EmotionalTwitter/vader.py", line 22, in 
<module>
    analyzer = SentimentIntensityAnalyzer()
  File "/usr/local/lib/python3.6/site-
packages/vaderSentiment/vaderSentiment.py", line 199, in __init__
    self.lexicon_full_filepath = f.read()
  File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/l
ib/python3.6/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 6573: ordinal not in range(128)
[Finished in 0.5s with exit code 1]

Why does it complain about this "ascii codec"? Because if I've read their documentation correctly this should be in utf-8 anyway. Also, I'm using Python 3.6.2.

0

There are 0 best solutions below