Closed MilanDeruelle closed 1 year ago
I haven't done an in depth look, but at first glance, it seems to me that your line
vs = analyzer.polarity_scores(sentence)
is attempting to run sentiment analysis on a variable sentence
that I do not see defined elsewhere (at least in the code you show)...
Perhaps you meant to run the sentiment analysis on the variable you define as msg
that contains text from WhatsApp chat log?
(e.g., the line might need to be: vs = analyzer.polarity_scores(msg)
).
Thats embarrassing... thanks for your help!
I'm trying to run the sentiment analysis over a long chat history, however the scores for "positive" are always 0, I never get a compound score > 0. I believe two other issues might refer to the same problem, but fail to mention it.
I'm attaching the code I'm running, however it should be a straight forward example. There are almost 20k messages and most of them should be fairly positive, so I'm wondering what I am missing or if there might be a bug in the pip package.
One example score I get:
{'neg': 0.387, 'neu': 0.613, 'pos': 0.0, 'compound': -0.5849} Products of france are great, that’s it