I have a df structured as follows:
text | sentiment |
---|---|
XXXXX | yes |
YYYYYY | no |
I'm trying to check the accuracy manually, according to this code ... however, I can't apply it to my DF. and I have the following error: ValueError: too many values to unpack (expected 2)
for text, sentiment in df:
classification = TextBlob(text).sentiment.polarity
if (classification <=0 and sentiment == "no"):
Sum_classification +=1
elif (classification >=0 and sentiment =="yes"):
Sum_classification +=1
print("the Accuracy is ", Sum_classification/len(df))
So, I decided to transform this to the list using the following code, which makes the code run without error, but I don't have the expected result, once I get
the Accuracy is 0.0
list = list(zip(df_test['text'], df_test['sentiment']))