0

I have a CSV file I am trying to train on a classifier. I am using TextBlob. This is my code that does it.

with open('train.csv', 'r') as fp:
    cl = NaiveBayesClassifier(fp, format='csv', feature_extractor= get_features)

It however does not seem to work. Is this the correct way to train a classifier using a CSV file?

4

1 回答 1

0

问题似乎在第三个论点。get_features 未定义。尝试这个 -

cl=NaiveBayesClassifier(fp)

它对我有用。

于 2015-05-25T07:56:27.880 回答