Response

Sample response:

The restaurant was great even though it’s not near Madrid.

{
"status":{
"code":
"0"
"msg":
"OK"
"credits":
"1"
}
"model":
"general_en"
"score_tag":
"P+"
"agreement":
"AGREEMENT"
"subjectivity":
"OBJECTIVE"
"confidence":
"100"
"irony":
"NONIRONIC"
"sentence_list":[
0:{
"text":
"The restaurant was great even though it’s not near Madrid."
"inip":
"0"
"endp":
"57"
"bop":
"y"
"confidence":
"100"
"score_tag":
"P+"
"agreement":
"AGREEMENT"
"segment_list":[
...
]
"sentimented_entity_list":[
...
]
"sentimented_concept_list":[
...
]
}
]
"sentimented_entity_list":[
0:{
"form":
"Madrid"
"id":
"3d0a16c68d"
"type":
"Top>Location>GeoPoliticalEntity>City"
"score_tag":
"NONE"
}
]
"sentimented_concept_list":[
0:{
"form":
"restaurant"
"id":
"4d5e117421"
"type":
"Top>Location>Facility"
"score_tag":
"P+"
}
]
}

Response object:

NameDescription
statusDescribes the request outcome in terms of success or failure.
status.codeNumerical value of result code. Refer to the error code catalog.
status.msgHuman-readable error code, if any, orOK.
status.credits

Credits consumed by the request. A credit corresponds to a bucket of 500 words.

Did you know...?

Only successful requests consume credits.

status.remaining_creditsCredits left to reach the usage limit.
modelHolds the model used in the evaluation followed by an underscore and the language in which the analysis has been carried out.
score_tagPolarity of the element it refers to: global polarity,polarity_term, sentimented_concept, sentimented_entity, segment or sentence. Possible values:
  • P+: strong positive
  • P: positive
  • NEU: neutral
  • N: negative
  • N+: strong negative
  • NONE: without polarity
agreementMarks the agreement between the sentiments detected in the text, the sentence or the segment it refers to. It has two possible values:
  • AGREEMENT: the different elements have the same polarity.
  • DISAGREEMENT: there is disagreement between the different elements' polarity.
subjectivityMarks the subjectivity of the text. It has two possible values:
  • OBJECTIVE: the text does not have any subjectivity marks.
  • SUBJECTIVE: the text has subjective marks.
confidencerepresents the confidence associated with the sentiment analysis performed on the text. Its value is an integer number in the 0-100 range.
ironyIndicates the irony of the text. It has two possible values:
  • NONIRONIC: the text does not have any irony marks.
  • IRONIC: the text has irony marks.
sentence_listList of sentences in which the text is divided. Each sentence is represented by a sentence object.
sentimented_entity_list

This is a list of the entities identified in the text with a certain polarity. These entities are the same ones that would be detected by the Topics Extraction API, the only difference will be in the Hashtags, Cashtags and Nicknames entities. These cases, because of their special importance in social media analyses, will also include (in the cases they have it), their known subtopics. For instance, if @BBC is detected, it will apear as a nickname, but also as the entity "BBC" (a Media Company).

Each one will be represented by an element sentimented entity.

sentimented_concept_listThis is a list of the concepts identified in the text with a certain polarity. Each one will be represented by an element sentimented concept.

Sentence object

A sentence in the text is represented by a sentence objects with the following structure:

Sentence object attributes

NameDescription
textText of the sentence
inipPosition of the first character of the sentence (zero indexed).
endpPosition of the last character of the sentence (zero indexed).
bopMarks if the sentence is the beginning if the paragraph (y or n)
confidenceRefer to the confidence parameter in the response object.
score_tagRefer to the score_tag parameter in the response object.
agreementRefer to the agreement parameter in the response object.
segment_listList of segments in which each sentence has been divided to perform the analysis. Each segment represents a fragment of the sentence that expresses a single opinion
segment_list[].textText of the segment
segment_list[].segment_typeThis field indicates if the segment has been used to compute the aggregated polarity of its parent. It has two possible values:
  • main: the segment is used to compute the aggregated polarity of its parent.
  • secondary: the segment is not used used to compute the aggregated polarity of its parent.
An example would be the sentence "The handsome gentleman stole the Crown Jewels". In this case, "The handsome gentleman" will be a secondary segment of the sentence, as the polarity expressed in it won't have any weight for the aggregated polarity of the sentence it's in.
segment_list[].inipPosition of the first character of the segment (zero indexed).
segment_list[].endpPosition of the last character of the segment (zero indexed).
segment_list[].confidenceRefer to the confidence parameter in the response object.
segment_list[].score_tagRefer to the score_tag parameter in the response object.
segment_list[].agreementRefer to the agreement parameter in the response object.
segment_list[].polarity_term_listList of words with polarity found in the segment. Polarity terms may have different polarities depending on their context: their polarity may be amplified, inverted or determined by their surrounding words.
segment_list[].polarity_term_list[].textText of the term, including in parentheses the polarity modifiers it is affected by, and the context words used to determine its polarity. In the cases where the polarity term is formed by several words, they will be separated by _.
segment_list[].polarity_term_list[].inipPosition of the first character of the term (zero indexed).
segment_list[].polarity_term_list[].endpPosition of the last character of the term (zero indexed).
segment_list[].polarity_term_list[].tag_stackPolarity modifiers affecting this polarity term. It appears only when verbose=y.
segment_list[].polarity_term_list[].confidenceRefer to the confidence parameter in the response object.
segment_list[].polarity_term_list[].score_tagRefer to the score_tag parameter in the response object.
segment_list[].polarity_term_list[].sentimented_entity_listIn the cases where they exist, this will contain a list of entities affected by the polarity term. Each element will be tagged as a sentimented entity object.
segment_list[].polarity_term_list[].sentimented_concept_listIn the cases where they exist, this will contain a list of concepts affected by the polarity term. Each element will be tagged as a sentimented entity object.
segment_list[].segment_listEach segment can have another segment_list field if the sentiment analyzer detects smaller segments inside it. These segments are the smallest level of fragmentation that the system can detect. This second level of elements will only appear if necessary.
segment_list[].sentimented_entity_listList of the entities identified in the segment but that are not affected by the polarity terms identified in it.
segment_list[].sentimented_concept_listList of the concepts identified in the segment but that are not affected by the polarity terms identified in it.
sentimented_entity_listList of the entities identified in the sentence.
sentimented_concept_listList of the concepts identified in the sentence.

Entity and concept objects

The entities and concepts that are detected in the text will appear in different elements of the output. The sentimented_entity_list and sentimented_concept_list associated to polarity terms will contain the same polarity information as the polarity term they are included in; they will also have information about the entity/concept appearance. In the case of the entities not affected by the polarity of a segment, they will also contain information about their appearance and the polarity value associated will be NONE.

Both elements have the same fields:

Sentence object attributes

NameDescription
formMain form of the entity/concept in the language specified in the ilang parameter.
idID of the entity/concept. This ID will correspond to its senseID in resources (including user resources). If the entity/concept has been detected in the analysis, the ID will be specifically created for that analysis and will begin by two underscores.
variantHow the entity/concept appears in the text (only in polarity_term elements).
inipPosition of the first character of the entity or concept (only in polarity_term elements, zero indexed).
endpPosition of the last character of the entity or concept (only in polarity_term elements, zero indexed).
typeOntology type of the entity/concept. Refer to MeaningCloud's ontology.
score_tagRefer to the score_tag parameter in the response object.