Top Five Emotion / Sentiment Analysis APIs for understanding user sentiment trends.
By: Mandy Sidana
Tags: Sentiment Analysis, Tone Analyzer, Emotion Analysis, Text Analysis, Data Science

As we advance into the age of constant tweets and live-feeds, it is critical for any organisation to understand and track the general sentiment of its users at any given time.

Working on the same, I created a handy list of top five common emotional or sentiment analysis APIs which I found worth sharing and can be implemented for most projects.

IBM Watson Tone Analyzer API

The IBM Watson Tone Analyzer helps detect communication tones from written text. These communication tones can be categorised as emotion, language and social.

The emotion tones are categorised as anger, disgust, fear, joy, and sadness. The language tones are categorised as analytical, confident, and tentative. The social tones (Big Five personality traits) are categorised as openness, conscientiousness, Extraversion, agreeableness, and emotional range.

How the learning has been done?

A machine learning model was trained on conversations to predict the tone of new texts. The Support Vector Machine (SVM) has been used as the machine learning model. It was observed that about 30% of the samples have more than one associated tone, so they decided to solve a multi-label classification task rather than a multi-class classification. For each of the tones, they trained the model independently using One-Vs-Rest paradigm. During prediction, the tones predicted with at least 0.5 probability were identified as the final tones.

Input Content: Sentences with less than three words cannot be analysed. This service supports up to 128KB of text (about 1000 sentences). A good use case would be tweets / Facebook posts of customers on company page.

Content-type: Valid values are text/plain, text/html, or application/json.

Output (result): Scores of the communication tones.

API Reference Link: https://www.ibm.com/watson/developercloud/tone-analyzer/api/v3/#introduction

Qemotion (Text to emotion API)

Qemotion helps detect the following:

Emotional index expressed into the speech.

Key primary emotions expressed

Main sensations evoked by audience in their feedback

Speech engagement

Text semantic automatic analysis

Qemotion asks users to submit a text using API and the algorithm will detect the main emotion of the speech and will define the corresponding emotion in terms of temperature (literally temperature). The following shall make it clearer:

From 31°C to 40°C : Happiness; From 21°C to 30°C : Surprise From 11°C to 20°C : Calm From 6°C to 10°C : Fear From -5°C to 5°C : Sadness and Disappointment From -14°C to -6°C : Anger From -20°C to -15°C : Disgust

Note: The semantic algorithms use statistic models to calculate emotional results with more than 85% accuracy.

Input Content: text (nothing mentioned about limit)

Content-type: application/json, charset=UTF-8

It is a French company and has been trusted by companies like Schneider, Klepierre, Cosair, Nelcom and many others.

Link: https://market.mashape.com/Qemotion/texttoemotions/overview

Documentation link: http://www.qemotion.com/api/documentation

SITE: http://www.qemotion.com/

AYLIEN API

AYLIEN Text API is a package of Natural Language Processing, Information Retrieval and Machine Learning tools for extracting meaning and insight from textual and visual content. This API can be used for various tasks such as:

It is important to note that this API does not provide any detailed analysis of text like emotions and other insights but in terms of sentiments it gives the polarity (positive or negative) and subjectivity (subjective or objective).

Documentation : http://docs.aylien.com/docs/usage

Cost: — The free plan includes 30k Hits/month.

Pricing options can be viewed at https://developer.aylien.com/plans

PreCeive API

A text analysis processor that covers things like sentiment analysis, , emotional analysis & speculation detection . Moreover, its open source API client is available for Node JS.

It analyses emotion dimension labels, each with a confidence value from the prediction, and covers the following basic unbounded emotion dimensions:

anger1D — 1-dimensional anger scale (> 0). fear1D — 1-dimensional fear scale (> 0). shame1D — 1-dimensional shame scale (> 0). surprise1D — 1-dimensional surprise scale (> 0). calm2D — 2-dimensional scale between calmness (> 0) vs. agitation (< 0). happy2D — 2-dimensional scale between happiness (> 0) vs. sadness (< 0). like2D — 2-dimensional scale between liking (> 0) vs. disliking/disgust (< 0). sure2D — 2-dimensional scale between certainty/sureness (> 0) vs. uncertainty/unsureness (< 0).

Input: text body (but not more than 20000 characters)

Pricing: http://docs.theysay.apiary.io/#introduction/quotas-and-rate-limits



Documentation: http://docs.theysay.apiary.io/#introduction

MoodPatrol API

MoodPatrol helps analyse texts and extract the underlying emotions. This API uses sophisticated text analysis to find emotion patterns in text. It helps detect 8 basic emotions and a wide variety of finer emotions from the texts.

These basic emotions are anger, fear, sadness, disgust, surprise, anticipation, trust, and joy.

There’s also a ton of fine-grained emotions

Example:

“How is the weather? it is sunny and dusty. Even though it breezes a bit, I can hear noise made from passing cars.”

Emotions detected: disgust, joy rough, horrible, bitter, boredom, hungover, warm, optimistic, optimism, peaceful, fantastic

Input: It takes text input of at least two words.

Pricing: Paid API, here;s a link to price https://market.mashape.com/soulhackerslabs/moodpatrol-emotion-detection-from-text/pricing

Documentation: https://market.mashape.com/soulhackerslabs/moodpatrol-emotion-detection-from-text/support

Demo: http://demo.soulhackerslabs.com/

Indico API

Detects emotions — anger, joy, fear, sadness and surprise from texts. It will take input as some text and give an output in a clean JSON form as below

‘anger’: 0.007581704296171665,

‘joy’: 0.07016665488481522,

‘fear’: 0.8000516295433044,

‘sadness’: 0.02512381225824356,

‘surprise’: 0.06534374748375202

Pricing: 10,000 free calls per month, chargeable after this. https://indico.io/plans

Documentation: https://indico.io/docs#emotion

That concludes our list of Top 5 Sentiment Analysis APIs

But there are so many great and awesome emotion analysis, mood analysis or sentiment analysis APIs that we cant really cover them in one article. Here are few more APIs you should consider for your next project.

Text analysis Engines

Also here are some text extraction / analysis engines you might wanna consider using prior to sentiment analysis. Clean data is much more likely to generate accurate results.

- sentaero.com

- textrazor.com

- text-processing.com

Microsoft text analytics API

Detect sentiment, key phrases, topics, and language from text.

Documentation: https://docs.microsoft.com/en-gb/azure/cognitive-services/Text-Analytics/overview

Lexalytics API

Documentation: https://www.lexalytics.com/semantria

Datumbox

Documentation: http://blog.datumbox.com/how-to-build-your-own-facebook-sentiment-analysis-tool/

sensq.com

This API provides dimension labels, each with a confidence value from the prediction, and covers the basic unbounded emotion dimensions.

In their own words “SensQ is an Earned Media Discovery, Analytics & Mass Social Engagement tool for Twitter, Facebook, Instagram, Blogs, Forums & News.”