Detailed API Output Explanation

Detailed Mode Output

Detailed Mode performs analysis on individual documents. In the Semantria API the user can customize almost every part of the analysis; from constraining the number of results for each category to defining the parts of speech which the server will detect, the user can configure Detailed Mode to suit your needs in document sentiment analysis. In this section, we provide a quick reference for customizable options and parameters for POS tagging, as well as a detailed explanation of Detailed Mode's output.

Line-by-line Term Explanation

This output is from analyzing the text below. Take note that it has been abbreviated is some spots for clarity.

Recently a toy catalog went out. If you did not get one you are SOL. I just called the corporate and they were mailed at random and put only in certain news papers. You can not get them at the store or ask corporate to send you one. There were some really good coupons like this week 25% off one toy. There was a different coupon each week. I think that this is so wrong. I for one have a target card just for Christmas shopping and would have loved those coupons. And since I have a card I would think a catalog should have been sent to me. Guess who will not be shopping at Target this year!

{
    # This array shows all the auto categories (wikipedia categories) found in the text
    "auto_categories": [{ 
            # These are the categories within the auto category. Note that not all auto categories will have categories
            "categories": [{
                    "sentiment_polarity": "neutral",
                    "sentiment_score": 0.4875,
                    "strength_score": 0.5772358,
                    "title": "Bonds",
                    "type": "info"
                }, {
                    "sentiment_polarity": "neutral",
                    "sentiment_score": 0.4875,
                    "strength_score": 0.523945,
                    "title": "Discount_stores",
                    "type": "info"
                }, {
                    "sentiment_polarity": "neutral",
                    "sentiment_score": 0.4875,
                    "strength_score": 0.5088412,
                    "title": "Government_bonds",
                    "type": "info"
                }, {
                    "sentiment_polarity": "neutral",
                    "sentiment_score": 0.4875,
                    "strength_score": 0.46849313,
                    "title": "Private_currencies",
                    "type": "info"
                }
            ],
            # This is the sentiment polarity for the auto category
            "sentiment_polarity": "neutral",
            # This is the sentiment score for the auto category
            "sentiment_score": 0.4875,
            # This is the relevance score for the auto category
            "strength_score": 0.8387881,
            # This is the title of the auto category
            "title": "Business",
            # This is the type of auto category - node for a category that can contain other categories (as this example does), leaf for categories at the end of the tree
            "type": "node"
        }
    ],
    # This is the ID of the config used to process the data
    "config_id": "486e1e63-2748-4a38-a457-862d92219fec",
    # This array give the details of the document. Each element in the array is a sentence. Only a single sentence from the example text is shown here due to length. 
    "details": [{
            # If the sentence is imperative or not
            "is_imperative": false,
            # If the sentence should carry sentiment
            "is_polar": true,
            # This array lists all of the words in the sentence
            "words": [{
                    # Was the word negated by a negator
                    "is_negated": false,
                    # Sentiment score for the word
                    "sentiment_score": 0.0,
                    # Stemmed form of the word
                    "stemmed": "recent",
                    # Part of speech tag. See http://dev.lexalytics.com/wiki/pmwiki.php?n=Main.POSTags for all tags
                    "tag": "RB",
                    # Actual word
                    "title": "Recently",
                    # Normalized part of speech tag
                    "type": "Adjective"
                }, {
                    "is_negated": false,
                    "sentiment_score": 0.0,
                    "stemmed": "a",
                    "tag": "DT",
                    "title": "a",
                    "type": "Determiner"
                }, {
                    "is_negated": false,
                    "sentiment_score": 0.0,
                    "stemmed": "toy",
                    "tag": "NN",
                    "title": "toy",
                    "type": "Noun"
                }, {
                    "is_negated": false,
                    "sentiment_score": 0.0,
                    "stemmed": "catalog",
                    "tag": "NN",
                    "title": "catalog",
                    "type": "Noun"
                }, {
                    "is_negated": false,
                    "sentiment_score": 0.0,
                    "stemmed": "go",
                    "tag": "VBD",
                    "title": "went",
                    "type": "Verb"
                }, {
                    "is_negated": false,
                    "sentiment_score": 0.0,
                    "stemmed": "out",
                    "tag": "RP",
                    "title": "out",
                    "type": "Misc"
                }, {
                    "is_negated": false,
                    "sentiment_score": 0.0,
                    "stemmed": ".",
                    "tag": ".",
                    "title": ".",
                    "type": "Symbol"
                }
            ]
        }, {
            # Other sentences omitted for length
        }
    ],
    # This array lists all entities found
    "entities": [{
            # Did the entity match the optional confidence query
            "confident": true,
            # What type of entity is it
            "entity_type": "Company",
            # How much sentiment evidence is there?
            "evidence": 1,
            # Was this entity a focus of the text?
            "is_about": false,
            # The label of the entitiy. This can be overridden in user-defined entities.
            "label": "Company",
            # Array of actual mentions of the entity.
            "mentions": [{
                    # Was the entity negated ?
                    "is_negated": false,
                    # Actual word found in text
                    "label": "Target",
                    # Locations info can be ued for hit-highlighting.
                    "locations": [{
                            "length": 6,
                            "offset": 582
                        }
                    ]
                }
            ],
            # Sentiment for the entity in words
            "sentiment_polarity": "neutral",
            # Sentiment for the entity as a float
            "sentiment_score": 0.0,
            # This entity does not have themes, but if it did this is where you would see the themes associated with the entity
            "themes": [{
                    # Amount of sentiment evidence for this theme
                    "evidence": ###,
                    # Is this theme a focus of the text?
                    "is_about" : (true or false),
                    # Array of actual mentions of the theme
                    "mentions": [{
                            "is_negated": (true or false),
                            "label": "",
                            "locations": [{
                                    "length": ###,
                                    "offset": ###
                                }
                            ],
                             # If an object is negated, the negating phrase
                            "negating_phrase": ""
                        }
                    ],
                    # Normalized(lower - cased stemmed)version of the theme
                    "normalized": "",
                    # Sentiment for the theme in words
                    "sentiment_polarity": "",
                    # Sentiment for the theme in a float
                    "sentiment_score": ###,
                    # Stemmed version of the theme
                    "stemmed": "",
                    # Relevancy of the theme to the entity
                    "strength_score": ###,
                    # Actual words of the theme
                    "title": ""
                },
                 # More themes would be found here
            ],
            # Entity name
            "title": "Target",
            # Named entities are automatically discovered, user-entities are defined
            "type": "named"
        }
    ],
    # The relations array lists the relationships found in the text. None were found in this example so the below array is an empty example
    "relations": [{
             # Named relations are auto-discovered
            "type": "",
             # the words triggering the relationship
            "extra": "",
             # The entities involved in the relationship
            "entities": [{
                    "title": "",
                    "entity_type": ""
                }
            ],
             # Type of relationship
            "relation_type": "",
            "confidence_score": ###
        }
    ],
    # ID of the document
    "id": "5c8-0001",
    # The intentions portion of the results. Note that intentions are only offered in English
    "intentions": [{
            # Phrase showing intent
            "evidence_phrase": "can not get",
            # Intention type
            "type": "quit",
            # The what of the intent
            "what": "them",
            # The who of the intent
            "who": "You"
        }, {
            "evidence_phrase": "did not get",
            "type": "quit",
            "what": "one you",
            "who": "If you"
        }
    ],
    # Language of document
    "language": "English",
    # Confidence in the language
    "language_score": 0.16480173,
    # Any metadata passed to Semantria would be displayed here. This example did not use metadata
    "metadata": {
    },
    # This dictionary lists the model-based sentiment scores. There were no model-based sentiment scores in this example so the below is intentionally empty 
    "model_sentiment": {
         # likelihood the document had a mixed sentiment score
        "mixed_score": ###,
         # Model name.Semantria ships with a defaultmodel.
        "model_name": "",
         # Likelihood the document had a negative score
        "negative_score": ###,
         # Likelihood the document had a neutral score
        "neutral_score": ###,
         # Likelihood the document had a neutral score
        "positive_score": ###,
         # Most likely sentiment polarity in words
        "sentiment_polarity": ""
    },
    # This array lists all sentiment phrases found in the text.
    "phrases": [ {
            # Whether the phrase was intensified
            "is_intensified": false,
            # Whether the phrase was negated
            "is_negated": false,
            # length of phrase in bytes
            "length": 5,
            # beginning position of phrase in bytes
            "offset": 449,
            # Phrase sentiment in words
            "sentiment_polarity": "positive",
            # Phrase sentiment in float
            "sentiment_score": 0.565,
            # Actual phrase
            "title": "loved",
            # Whether detected or possible
            "type": "detected"
        }, {
            "sentiment_polarity": "neutral",
            "title": "been sent",
            # Semantria's suggestions of possible sentiment phrases to add to custom configuration
            "type": "possible"
        }, {
            "sentiment_polarity": "neutral",
            "title": "certain news",
            "type": "possible"
        }, {
            "sentiment_polarity": "neutral",
            "title": "different coupon",
            "type": "possible"
        }, {
            "sentiment_polarity": "neutral",
            "title": "not be",
            "type": "possible"
        }, {
            "sentiment_polarity": "neutral",
            "title": "not get",
            "type": "possible"
        }, {
            "sentiment_polarity": "neutral",
            "title": "not get",
            "type": "possible"
        }, {
            "is_intensified": false,
            "is_negated": false,
            "length": 11,
            "offset": 251,
            "sentiment_polarity": "neutral",
            "sentiment_score": 0.41,
            "title": "really good",
            "type": "detected"
        }, {
            "is_intensified": false,
            "is_negated": false,
            "length": 8,
            "offset": 366,
            "sentiment_polarity": "neutral",
            "sentiment_score": -0.4,
            "title": "so wrong",
            "type": "detected"
        }
    ],
    # Sentiment of document in words
    "sentiment_polarity": "neutral",
    # Sentiment of document as float
    "sentiment_score": 0.19166666,
    # Source text
    "source_text": "Recently a toy catalog went out. If you did not get one you are SOL. I just called\n the corporate and they were mailed at random and put only in certain news papers. You can\n not get them at the store or ask corporate to send you one. There were some really good\n coupons like this week 25% off one toy. There was a different coupon each week. I think\n that this is so wrong. I for one have a target card just for Christmas shopping and would\n have loved those coupons. And since I have a card I would think a catalog should have\n been sent to me. Guess who will not be shopping at Target this year!",
    # Semantria status of document
    "status": "PROCESSED",
    # Summary of document
    "summary": "Recently a toy catalog went out... I just called the corporate and they were mailed at random and put only in certain news papers... There were some really good coupons like this week 25% off one toy... ",
    # Array of themes relevant at a document level
    "themes": [{
            # Amount of sentiment evidence for this theme
            "evidence": 7,
            # Was this theme a focus of the text
            "is_about": false,
            # Array of actual mentions of the theme
            "mentions": [{
                    # Was the mention negated
                    "is_negated": false,
                    # Actual mention
                    "label": "different coupon",
                    # Mention location can be used for hit-highlighting
                    "locations": [{
                            "length": 16,
                            "offset": 316
                        }
                    ]
                }
            ],
            # Normalized version of theme
            "normalized": "different coupon",
            # Sentiment for theme in words
            "sentiment_polarity": "neutral",
            # Sentiment fpr theme in a float
            "sentiment_score": 0.41,
            # Stemmed version of the theme
            "stemmed": "different coupon",
            # Relevancy of the theme
            "strength_score": 1.25,
            # Actual words of the theme
            "title": "different coupon"
        }, {
            "evidence": 7,
            "is_about": true,
            "mentions": [{
                    "is_negated": false,
                    "label": "good coupons",
                    "locations": [{
                            "length": 13,
                            "offset": 258
                        }
                    ]
                }
            ],
            "normalized": "good coupon",
            "sentiment_polarity": "positive",
            "sentiment_score": 2.58,
            "stemmed": "good coupon",
            "strength_score": 1.5833334,
            "title": "good coupons"
        }, {
            "evidence": 4,
            "is_about": false,
            "mentions": [{
                    "is_negated": false,
                    "label": "target card",
                    "locations": [{
                            "length": 11,
                            "offset": 393
                        }
                    ]
                }
            ],
            "normalized": "target card",
            "sentiment_polarity": "positive",
            "sentiment_score": 0.565,
            "stemmed": "target card",
            "strength_score": 0.2,
            "title": "target card"
        }, {
            "evidence": 4,
            "is_about": true,
            "mentions": [{
                    "is_negated": false,
                    "label": "toy catalog",
                    "locations": [{
                            "length": 11,
                            "offset": 11
                        }
                    ]
                }
            ],
            "normalized": "toy catalog",
            "sentiment_polarity": "neutral",
            "sentiment_score": 0.205,
            "stemmed": "toy catalog",
            "strength_score": 0.33333334,
            "title": "toy catalog"
        }
    ],
    # This array lists topics discovered in the text. Topics include queries and concept topics (also known as user categories). This example only hit on a query so the below shows the query topic output.
    "topics": [{
            # The number of query terms that hit in the document
            "hitcount": 2,
            # The ID of the query
            "id": "4c640e2e-6e0f-44f9-a6c6-eca67f3962f3",
            # An array listing the term hits
            "mentions": [{
                    # Whether the term was negated
                    "is_negated": false,
                    # The term that hit
                    "label": "think",
                    # An array of locations of the term
                    "locations": [{
                            # The length in bytes of the term
                            "length": 5,
                            # The offset in bytes from the beginning of the document for the hit
                            "offset": 346
                        }, {
                            "length": 5,
                            "offset": 502
                        }
                    ]
                }
            ],
            # The sentiment polarity of the query
            "sentiment_polarity": "neutral",
            # The sentiment score of the query as a float
            "sentiment_score": 0.0,
            # The name of the query
            "title": "Customer Service",
            # The type of topic. This can be concept or query
            "type": "query"
        }
    ]
}

Detailed mode limits apply to both document mode and source mode of analysis. All limits have integer values of 0 to 20. Setting a limit to a score of 0 signifies zero interest in the output and will prevent the result for that parameter from appearing in the dataset.

Detailed Mode output explanation

Semantria provides the user with a wealth of information in its sentiment analysis and data processing; sometimes it can be kind of hard to wade through. Here is a quick reference detailing everything the Semantria API will return to the user in Detailed Analysis Mode.

Each document will have an id and each configuration has a unique config_id. The user can add tags and view the status of the document ("queued," "processed" or "failed"). Semantria API will produce a job_id of the associated job, a summary of the document text, the language of the source text (and the language score, the percentage of the best language match among detected languages), and the sentiment_score and sentiment_polarity.

In detailed analysis of individual sentences, the API will return boolean values for is_imperative and is_polar. Imperative sentences, representing an action item, will be set to true. is_polar represents Semantria's guess as to whether the writer of the sentence meant to convey sentiment. For instance, "Good morning all" is a non-polar sentence despite containing a sentiment word of "good."

The API will return a list of words grouped by the parent sentence. Each word will have a tag, POS type, title, stemmed form of the word, and sentiment_score.

Semantria API will generate auto_categories; each category will have a title, type ("node"/root or "leaf"/nested value), strength_score (how much the category matches with document content), and categories, an array of sub-categories (if any exist).

phrases are a list of sentiment-bearing phrases from the document. Each will have a title, sentiment_score, sentiment_polarity (negative, positive, or neutral), is_negated (whether the phrase has been negated), negating_phrase (if one exists), is_intensified, intensifying_phrase (if one exists), and type (either "possible" or "detected").

The Semantria API returns the themes of the document. Each has the title, main theme (is_about), the normalized form of the theme, the stemmed form of the theme, an evidence score, strength_score within the document, and sentiment_polarity. The API will return mentions of the theme: expandable, which is the text of the theme mention, is_negated, negating_phrase, and locations-- the list of coordinates of the mentions found within the document. offset is the number of bytes offset in the original text before the start of the mention, and length is the length of the mention in bytes.

The API returns entities with similar parameters to themes. Entities have additional parameters of type (either "named" or "user"), confident (whether the confidence queries matched for this entity), and the entity_type (Company, Person, Place, etc.). It will also return a list of themes related to this entity.

Semantria API returns relations, which represent a connection between one or more Entities. These have a type (named or user value), relation_type (such as quotation), confidence_score, and extra of the parent relationship.

The API will also return a list of opinions extracted from the source text. Each will have a quotation, type (the type of entity extracted-- named or user value), speaker, topic, sentiment_score and sentiment_polarity.

Finally, Semantria API gives a list of topics, each with a title, type, hitcount, strength_score, sentiment_score, sentiment_score and topics (a list of sub-topics, if they exist).