j=pd.read_excel('train1.xls', 'sheet1', na_values=['NA', '?'],header=None)
j.columns=['News','Sentiment']
train = [(j.News,j.Sentiment)]
cl = DecisionTreeClassifier(train)
Getting TypeError: basic_extractor() takes exactly 2 arguments (1 given) But while using the following code I am not getting any error:-
train = [('I love this sandwich.', 'pos'),
('This is an amazing place!', 'pos'),
('I feel very good about these beers.', 'pos'),
('I do not like this restaurant', 'neg'),
('I am tired of this stuff.', 'neg'),
("I can't deal with this", 'neg'),
("My boss is horrible.", "neg")
]
cl = DecisionTreeClassifier(train)
This time it is working. Do you know the what's the problem in the first case?
train = j[["News","Sentiment"]]trainand inspect very closely whats the difference between the two.