I am getting ValueError: too many values to unpack error . here is code sample
import numpy as np
import pandas as pd
from textblob.classifiers import NaiveBayesClassifier
sms_raw = pd.read_csv('text.csv')
# training dataset 70%
# test dataset 30 %
sms_raw['split'] = np.random.randn(sms_raw.shape[0], 1)
fltr = np.random.rand(len(sms_raw)) <= 0.7
train = sms_raw[fltr]
test = sms_raw[~fltr]
cl = NaiveBayesClassifier(sms_raw)
The NaiveBayesClassifier will not work with a pandas dataframe as an input. Also, in your last line you are taking the sms_raw data as an input, I'm guessing you meant:
cl = NaiveBayesClassifier(train)
You'll need to read in the csv file directly or convert the pandas dataframes to a list.
Try using
train.to_dict(orient='records')
cl = NaiveBayesClassifier(train)
If you want to read in the csv directly look at this example: https://github.com/sloria/TextBlob/issues/142