utf-8' codec can't decode byte 0xaa in position 148: invalid start byte

Viewed 28

I checked my file which is already encoded in utf-8, but somehow it still pops out this error. Would be so much appreciated if anyone could enlighten me.

import nltk

pairs = [(fileid, word) 

          for fileid in corpora.fileids()

          for word in [word.lower() for word in corpora.words(fileid)]]
cfd = nltk.ConditionalFreqDist(pairs)

count_word = ['can', 'the', "I"]

cfd.tabulate(samples = count_word)
0 Answers
Related