Emotion
IntroductionThe Lettria API can identify and extract emotion from text data at the sentence level , and automatically classify it according to the emotion it conveys.
FormatEmotions are received inside an Array()
for each subsentences A comprehensive list of emotions can be found here .
Emotion
Emotion Format
Subsentence Emotion
Subsentence Emotion FormatKey Type Description start_id
Number
Start ID end_id
Number
End ID elements
Element [ ]Elements sentence
String
Sentence values
Values
Values
Subsentence Emotion Example{
"start_id": 0,
"end_id": 2,
"elements": [
{
"target": {
"lemma": "voyage",
"source": "voyage",
"index": 2
},
"subject": null,
"value": { "admiration": 1, "joy": 1 },
"source": { "index": 1, "lemma": "beau", "source": "beau" }
}
],
"sentence": "un beau voyage",
"values" : [ { "type": "admiration", "value": 1 }, { "type": "joy", "value": 1 } ]
}
Copy
Values
Values FormatKey Type Description type
Emotion .Positive value
Number
Positive
Values Example[
{ "type": "admiration", "value": 1 },
{ "type": "joy", "value": 1 }
]
Copy
Emotion Element
Emotion Element Format
Emotion Element Example{
"target": { "lemma": "voyage", "source": "voyage", "index": 2 },
"subject": null,
"value": { "admiration": 1, "joy": 1 },
"source": { "index": 1, "lemma": "beau", "source": "beau" }
}
Copy
Value
Value FormatKey Type Description Emotion .Number
Positive
Value Example{ "admiration": 1, "joy": 1 }
Copy
Target
Target FormatKey Type Description index
Number
Index lemma
String
Lemma source
String
Source
Target Example{ "lemma": "immeuble", "source": "immeubles", "index": 6 }
Copy
Subject
Subject FormatKey Type Description index
Number
Index lemma
String
Lemma source
String
Source
Subject Example{ "lemma": "Victor", "source": "Victor", "index": 0 }
Copy
Next steps