cjhutto / vaderSentiment

VADER Sentiment Analysis. VADER (Valence Aware Dictionary and sEntiment Reasoner) is a lexicon and rule-based sentiment analysis tool that is specifically attuned to sentiments expressed in social media, and works well on texts from other domains.
MIT License
4.38k stars 1k forks source link

Wrong sentiments returned when using Space character prefixed strings as input #107

Open vsaifi opened 4 years ago

vsaifi commented 4 years ago

from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer text=SentimentIntensityAnalyzer()

Input Sample 1: (Please note the 'space' before the strings in input array. ) score = text.polarity_scores([" Nothing is going wrong", " Nothing is going wrong", " Nothing is going wrong"] )

Input Sample 2: (No 'space' before the strings in input array. ) score=text.polarity_scores(["Nothing is going wrong", "Nothing is going wrong", "Nothing is going wrong"] )

Result of Sample 1:

Screenshot 2020-07-30 at 1 30 17 PM

Result of Sample 2:

Screenshot 2020-07-30 at 1 29 48 PM