We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9b8b80a commit 22bc140Copy full SHA for 22bc140
ch05/classify.py
@@ -54,6 +54,7 @@ def prepare_sent_features():
54
if not text:
55
meta[pid]['AvgSentLen'] = meta[pid]['AvgWordLen'] = 0
56
else:
57
+ text = text.decode('utf-8')
58
sent_lens = [len(nltk.word_tokenize(
59
sent)) for sent in nltk.sent_tokenize(text)]
60
meta[pid]['AvgSentLen'] = np.mean(sent_lens)
0 commit comments