I am working on a dataset of airline customer complaints. Since it is "complaints" the general consensus is all the sentence are "negative" sentiment. So I am think of an approach to quantize the negativity score.

For example:

Less Negative review:

 "the cabin did not have enough leg space but the food was decent" - Score: 0.3

High Negative Review:

"complete service was horrible, I will not recommend them ever" - Score: 0.8

Any suggestions on existing approaches?

P.S I am not looking for an exact answer, any suggestions on the direction or approaches would be great.

2 Answers 2


In general, this is called sentiment analysis aka opinion mining; putting either of those into Google will give dozens of different possible starting points.

One model I've used before is VADER, which is specifically tuned to online reviews and social media posts; if you're using Python, it's available through the NLTK (natural language toolkit) library, or on its own through Pypi.

To get started, you can use something like this:

from nltk.sentiment.vader import SentimentIntensityAnalyzer

analyzer = SentimentIntensityAnalyzer()
scores = analyzer.polarity_scores(my_sentence)

And that's all there is to it! Now scores is a dictionary with four keys, giving the probability that the sentence is positive (pos), negative (neg), or neutral (neu), along with an estimate of how intense the feeling is (compound: negative values mean negative sentiment, positive values mean the opposite).

There's also a longer demo here if you scroll down to the second heading, showing how you might use it inside a larger program.


There is a large literature on negation. Here is a place to start.

Specifically on quantization, it might be interesting to classify various forms of negation with regard to how grammatically oblique they are. I use numbers corresponding to the 1,2,3 of Relational Grammar, supplemented by a 0 relation for least oblique. Higher numbers are more oblique, appearing lower down in a grammatical tree structure. From more to less oblique: "I saw no one ever./I didn't ever see anyone./I never did see anyone./Never did I see anyone."

  • I am not focused on negation in particular. I am trying to quantize the complete negative sentiment in the sentence. May 24, 2019 at 22:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.