相关疑难解决方法(0)

nltk NaiveBayesClassifier培训情绪分析

我正在NaiveBayesClassifier使用句子训练Python,它给出了下面的错误.我不明白错误是什么,任何帮助都会很好.

我尝试了很多其他输入格式,但错误仍然存​​在.代码如下:

from text.classifiers import NaiveBayesClassifier
from text.blob import TextBlob
train = [('I love this sandwich.', 'pos'),
         ('This is an amazing place!', 'pos'),
         ('I feel very good about these beers.', 'pos'),
         ('This is my best work.', 'pos'),
         ("What an awesome view", 'pos'),
         ('I do not like this restaurant', 'neg'),
         ('I am tired of this stuff.', 'neg'),
         ("I can't deal with this", 'neg'),
         ('He is my sworn enemy!', 'neg'),
         ('My boss is horrible.', 'neg') ]

test = [('The beer …
Run Code Online (Sandbox Code Playgroud)

python nlp nltk sentiment-analysis textblob

22
推荐指数
3
解决办法
3万
查看次数

标签 统计

nlp ×1

nltk ×1

python ×1

sentiment-analysis ×1

textblob ×1