Sentiment Analyzer

Before you read on, please note that sentiment analysis is currently only available for English. We're working on models for other languages.

The goal of sentiment analysis is to determine the overall sentiment expressed in a piece of text or speech, and classify it as positive, negative, or neutral.

Sentiment is broken down into two different parts - polarity and subjectivity.

Polarity

Polarity refers to the overall sentiment conveyed by a particular text, phrase or word.

The polarity score is expressed as a numerical rating known as a “sentiment score”. The score is a number between -1 (very negative) and 1 (very positive) with values nearer to 0 representing neutral sentiment.

Subjectivity

Subjectivity quantifies the amount of personal opinion and factual information contained in the text.

A higher subjectivity means that the text contains personal opinion rather than factual information. Subjectivity scores range from 0 to 1 with scores nearer to 0 being less subjective and scores nearer to 1 being more subjective.

The response section for sentiment would look similar to below:

json
{
  "sentiment": {
    "polarity": -0.2,
    "subjectivity": 0.64,
    "detail": [
      {
        "sentence": "My name is Julia Peach and I live in Paris.",
        "polarity": 0.14,
        "subjectivity": 0.5
      },
      {
        "sentence": "I ate at a restaurant in London and had a terrible meal.",
        "polarity": -1,
        "subjectivity": 1
      },
      {
        "sentence": "It cost £50 for the starter which was quite unpleasant.",
        "polarity": -0.65,
        "subjectivity": 0.95
      },
      {
        "sentence": "It was 100% better than any desert I've ever been to.",
        "polarity": 0.5,
        "subjectivity": 0.5
      }
    ]
  }
}