Sentiments Results Schema for JSON#

The SentimentsResults schema describes the structure of the JSON data returned from the Sentiments application by the SDK or the Portal.

Definition#

The SentimentsResults schema is defined as:

  • array[SentimentResult] – The list of sentiments found in the document

  • positive (str) – The percentage of positive expressions found in the document

  • negative (str) – The percentage of negative expressions found in the document

with SentimentResult defined as:

  • object – The sentiment information

    • polarity (str) – the polarity of the sentiment, either positive or negative.

    • text (str) – The sentiment itself

    • object (str) – The object to which the sentiment refers to

    • adjective (str) – When the polarity comes from an adjective, like ‘beautiful’

    • noun (str) – When the polarity comes from a noun, like ‘crisis’

    • verb (str) – When the polarity comes from a verb, like ‘hate’

    • expression (str) – When the polarity comes from a verb, like ‘make waves’

    • begin_offset (int) – The begin offset of the sentiment.

    • end_offset (int) – The end offset of the sentiment.

Example#

The following is an example of the JSON results for this application:

eot_sentiments#
{
    "positive": 50.0,
    "negative": 50.0,
    "sentiments": [
        {
            "polarity": "positive",
            "text": "John Dow is a very nice Person",
            "begin_offset": 0,
            "end_offset": 30,
            "object": "John Dow",
            "adjective": "nice"
        },
        {
            "polarity": "negative",
            "text": "John Dow sucks",
            "begin_offset": 36,
            "end_offset": 44,
            "object": "John Dow",
            "expression": "suck",
            "comp": "intrans",
            "verb": "suck"
        }
    ]
}