Have run the code with both python 2 and 3.
UnicodeDecodeError Traceback (most recent call last)
<ipython-input-4-76d3725b79f2> in <module>()
57 sentences.extend(tricky_sentences)
58
---> 59 sid = SentimentIntensityAnalyzer()
60
61 for sentence in sentences:
//anaconda/lib/python3.5/site-packages/nltk/sentiment/vader.py in __init__(self, lexicon_file)
200 def __init__(self, lexicon_file="vader_lexicon.txt"):
201 self.lexicon_file = os.path.join(os.path.dirname(__file__), lexicon_file)
--> 202 self.lexicon = self.make_lex_dict()
203
204 def make_lex_dict(self):
//anaconda/lib/python3.5/site-packages/nltk/sentiment/vader.py in make_lex_dict(self)
208 lex_dict = {}
209 with codecs.open(self.lexicon_file, encoding='utf8') as infile:
--> 210 for line in infile:
211 (word, measure) = line.strip().split('\t')[0:2]
212 lex_dict[word] = float(measure)
//anaconda/lib/python3.5/codecs.py in __next__(self)
709
710 """ Return the next decoded line from the input stream."""
--> 711 return next(self.reader)
712
713 def __iter__(self):
//anaconda/lib/python3.5/codecs.py in __next__(self)
640
641 """ Return the next decoded line from the input stream."""
--> 642 line = self.readline()
643 if line:
644 return line
//anaconda/lib/python3.5/codecs.py in readline(self, size, keepends)
553 # If size is given, we call read() only once
554 while True:
--> 555 data = self.read(readsize, firstline=True)
556 if data:
557 # If we're at a "\r" read one extra character (which might
//anaconda/lib/python3.5/codecs.py in read(self, size, chars, firstline)
499 break
500 try:
--> 501 newchars, decodedbytes = self.decode(data, self.errors)
502 except UnicodeDecodeError as exc:
503 if firstline:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xde in position 0: invalid continuation byte