Comments (4)
I am not involved in any of the researches that lead to this analyzer, but I've played quite a bit with it.
Vader returns the sentiment value as 3 floating points value in range 0 <= score <= 1, plus one additional compound value that mixes all three in one value in range -1 <= score <= 1. From the README:
The compound score is computed by summing the valence scores of each word in the lexicon, adjusted according to the rules, and then normalized to be between -1 (most extreme negative) and +1 (most extreme positive). This is the most useful metric if you want a single unidimensional measure of sentiment for a given sentence. Calling it a 'normalized, weighted composite score' is accurate.
It is also useful for researchers who would like to set standardized thresholds for classifying sentences as either positive, neutral, or negative. Typical threshold values (used in the literature cited on this page) are:
- positive sentiment: compound score >= 0.5
- neutral sentiment: (compound score > -0.5) and (compound score < 0.5)
- negative sentiment: compound score <= -0.5
The
pos
,neu
, andneg
scores are ratios for proportions of text that fall in each category (so these should all add up to be 1... or close to it with float operation). These are the most useful metrics if you want multidimensional measures of sentiment for a given sentence.
Based on this, I can tell that a strongly subjective sentence will have a compound
score close to 0, and a neu
score close to one. From my reading of the code, the neu
value increases as the proportion of words that match a subjective token from their lexicon decreases.
TL;DR: use the inverse of the neu
field of the returned sentiment value (1 - neu
). When neu = 1
, then subjectivity score is null (0). - when neu ~= 0
then you have the highest subjectivity score. Alternatively, you can use the inverse of the absolute value of the compound
score (1 - abs(compound)
).
from vadersentiment.
@Hiestaa how do you even figure out something like that?
from vadersentiment.
@rxng I've been working on the same idea than these guys (rule-based sentiment analysis in short texts), with much less time, effort and resources. When I found this, it was obviously working much better than whatever I managed to come up with.
I've spent some time replacing my stuff with theirs, thus studied the code and understood the inner workings of this project (as required to maintain this code in my own project). I've also extended it with debug information to get a better sense of the effect of each rule described here.
Really, just look at their code, try to run it locally and fire a step-by-step debugger. Add logging statements. It's by far not as complicated as other deep-learning approaches to sentiment analysis that appear to be more hyped by researchers these days.
from vadersentiment.
Cool! Thanks @Hiestaa it takes me a long time to understand the code and figure it out ( I am still a python newbie learning). Did try to tinker abit but didn't quite work out well.; Because I found it interesting that none of the sentiment analysis libraries could detect "limited staff support" as a negative sentence
from vadersentiment.
Related Issues (20)
- Dictionary contains phrases like "fed up" that will never hit because of how the sentence is tokenized HOT 1
- Is NLP still required when using VADER?
- vaderSentiment data output in a different order than specified in the docs
- Wrong weight assigned for hashtags with capitals
- Doubt about threshold values used in VADER categorization
- is this thing still alive?
- incorrect result while running on large dataset HOT 1
- Demo None Type not Iterable HOT 2
- Adding Turkish words HOT 2
- help with adding values to vader_lexicon.txt HOT 1
- Download additional DATASETS AND TESTING RESOURCES mentioned in README HOT 3
- Total dataset is decreasing after processed by VADER
- VADER can't parse the word 'bad ass'? HOT 2
- Positive score always 0? HOT 2
- `SPECIAL_CASES` do not work HOT 2
- Support for new Emojis
- list index out of range error persists... HOT 1
- Supporting Aspect Based sentiment analysis
- Add Julia Fork Link To ReadMe
- the sentimentIntensityAnalyzer VADER is giving results only on emojicon logic and NOT text
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vadersentiment.