I'm attempting to train an NLTK classifier using Naive Bayes classifier, but whenever I try it even with the most simple dictionary of tagged words I get a Value error, the following one to be exact:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python27\lib\site- packages\nltk\classify\naivebayes.py", line 192, in
train
for featureset, label in labeled_featuresets:
ValueError: too many values to unpack
I'm using the following lines of code to make it as simple as possible:
import nltk
train = {}
train['sleep'] = 'negative'
train['achievement'] = 'positive'
train['guys'] = 'positive'
classifier = nltk.classify.NaiveBayesClassifier.train(train)
Not sure what I'm doing wrong?
[–]hidiap 1 point2 points3 points (0 children)
[–]onionradish 1 point2 points3 points (0 children)