我正在使用Vader SentimentAnalyzer获取极性分数.之前我使用了正/负/中性的概率分数,但我刚刚意识到"复合"分数,范围从-1(大多数负)到1(大多数pos)将提供单一的极性测量.我想知道如何计算"复合"分数.这是从[pos,neu,neg]向量计算的吗?
我试图使用polarity_scores()NLTK中的Vader情绪分析,但它给了我错误:
polarity_scores()缺少1个必需的位置参数:'text'
我完全是Python的初学者.感谢您的帮助!
from nltk.sentiment.vader import SentimentIntensityAnalyzer as sid
sentences=["hello","why is it not working?!"]
for sentence in sentences:
ss = sid.polarity_scores(sentence)
Run Code Online (Sandbox Code Playgroud)