我正在使用NLTK3进行阿拉伯语文本分类。

"calssifier =NaiveBayesClassifier.train(train_set)
  File "/usr/local/lib/python2.7/dist-packages/nltk/classify/naivebayes.py", line 194, in train
    for fname, fval in featureset.items():
AttributeError: 'unicode' object has no attribute 'items'"


谢谢

最佳答案

train_set应该是一个字符串,应该是字典。

10-06 08:02