sentiment-analysis

nltk NaiveBayesClassifier training for sentiment analysis

主宰稳场 提交于 2019-11-26 15:13:45
I am training the NaiveBayesClassifier in Python using sentences, and it gives me the error below. I do not understand what the error might be, and any help would be good. I have tried many other input formats, but the error remains. The code given below: 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

nltk NaiveBayesClassifier training for sentiment analysis

空扰寡人 提交于 2019-11-26 04:19:12
问题 I am training the NaiveBayesClassifier in Python using sentences, and it gives me the error below. I do not understand what the error might be, and any help would be good. I have tried many other input formats, but the error remains. The code given below: 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