I have the following code snippet
classifier = NaiveBayesClassifier.train(train_data)
#classifier.show_most_informative_features(n=20)
results = classifier.classify(test_data)
and the error shows in the following line
results = classifier.classify(test_data)
error:
Traceback (most recent call last):
File "trial_trial.py", line 46, in <module>
results = classifier.classify(test_data)
File "c:\Users\Amr\Anaconda\lib\site-packages\nltk\classify\naivebayes.py", line 88, in classify
return self.prob_classify(featureset).max()
File "c:\Users\Amr\Anaconda\lib\site-packages\nltk\classify\naivebayes.py", line 94, in prob_classify
featureset = featureset.copy()
AttributeError: 'list' object has no attribute 'copy'
I think of extending base class list in python and add copy function but I'm not expert in python and I don't know how to solve this problem.