Method | Path |
---|---|
GET |
https://agora.olery.com/v3/sentiment |
POST |
https://agora.olery.com/v3/sentiment |
This endpoint runs sentiment analysis through an input text.
A text has its language identified and then analysed with Olery’s Natural Language Processing tools. Polarities are identified and connected to words. Words are categorized into sentiment ratings (also called topics or properties).
Example Request
https://agora.olery.com/v3/sentiment?auth_token=X&property_type=accommodation&input=The+hotel+was+terrific
Parameters
The following are the parameters used for filtering:
Parameter | Parameter Type | Data Types | Required | Description |
---|---|---|---|---|
property_type | query | String | false | Lexicon set to use, see below for details |
Olery Sentiment Analysis is currently composed of different types of lexicons for different property types or verticals. First, we have lexicons for polarity identification, intensifiers and shifters. Then for each vertical there is set of rating and subratings. Currently the following verticals identifiers are supported:
- accommodation
- restaurant
- attraction
- airport
- airline
Output Format
Field | Data Types | Description |
---|---|---|
language | Object | Identified language’s code and name attributes |
score | Float | An overall sentiment score value from -1 to 1 |
overall | String | Positive, negative or neutral overall score, see details below |
opinions | Array | An array of all opinions found, see details below |
sentences | Array | An array of sentences and their tokens, see details below |
Scoring
A general score is generated for the input text provided, ranging from -1 to -1. Strength and quantity of positive and negative opinions are taken into consideration for calculation.
Values ranging from 0 to 0.5 are considered neutral, greater than 0.5 positive and lower than 0 negative.
Opinions
The opinions
array is composed of a list of all opinions found in the input text.
Each specify one or more subratings in the properties
field and the polarity found.
Field | Data Types | Description |
---|---|---|
polarity | Object | neutral , positive or negative polarity |
strength | Float | An indicator of strength depending on intensifiers lexicons |
properties | Array | A list of sentiment ratings identifiers |
Sentences
The sentences
array is a list of sentences each containing arrays of tokens separated for proper sentiment analysis.
Field | Data Types | Description |
---|---|---|
text | String | Source text extracted and tokenized |
lemma | String | Lemma (word in its base form) |
pos | String | PoS - Part of Speech - in a one letter representation |
morphofeat | String | PoS in the UPOS form |
polarity | String | neutral , positive or negative polarity |
strength | Integer | An indicator of strength depending on intensifiers lexicons |
properties | Array | A list of sentiment ratings identifiers |
type | String | open or close depending |
lexicon_type | String | intensifier , shifter or null for other lexicons |