Skip to main content
Version: 2.0

Document

The API output is divided into three levels. The first level of return is the Document level. Within the Document Object you will find the following return below.

Check out the Sentence and Details level to see the full list of objects.

Document Object

KeyTypeDescription
coreferencelist of Coreference ObjectList of found coreferences
clusterstringinput format
typestringtype of input (contract, article, tweet, reviews, conversation, etc.)
domainstringclassification by domain to allow loading certain dictionary / specific entities. (Healthcare, Legal, Finance etc.)
source_purestringsource of raw input
languageLanguage used ObjectLanguage detection
emoticonEmoticon Objectglobal text emoticons
sentimentSentiment Objectglobal sentiment from the text
emotionEmotions Objectglobal emotion from the text
sentencesstringlist of sentence
project idintegerproject ID used for analysis
API_versionintegerversion of the API

Document format

Here you have an example of the objects returned at a Document level.

input: 'The package was delivered on Tuesday.'

output :
{
‘coreference’ : {‘span’ : [
{ "sentence_index": 0, "token_indexes": [0], "cluster_index": 1},
{ "sentence_index": 0, "token_indexes": [2,3,4], "cluster_index": 0}
],
‘cluster’ : [
[1],
[0]
]},

type’ : ‘tweet’,
‘domain’ : ‘healthcare’

‘source_pure’ : "The package was delivered on Tuesday."
‘language’ : 'en'
'emoticon': []
‘sentiment’ : {'positive': 0, 'negative': 0, 'total': 0}
'emotion': []
'sentences' [The package was delivered on Tuesday.]
'project id' : 0
'API_version' :

Coreference

KEYTYPEDESCRIPTIONCONSTRAINTS
sourcestringsource word that makes the coreference query-
indexintindex of the source wordindex >= 0
precisionfloatprecision indices based on how the algorithm found the coreference. Higher is better0 <= precision <= 1
referenceReference Objectdescribes the best match for the coreference query

Cluster

KeyTypeDescription
clusterstringinput format

Type

KeyTypeDescription
typestringtype of input (contract, article, tweet, reviews, conversation, etc.)

Domain

KeyTypeDescription
domainstringClassification by domain to allow loading certain dictionary / specific entities. (Healthcare, Legal, Finance etc.)

source_pure

KeyTypeDescription
source_purestringsource of raw input

Language

Language code follows ISO 639-1.

KEYTYPEDESCRIPTION
predictstringcast fr because Lettria exits in French actually
sentence levelLanguage ObjectPredict language of sentence
word levelLanguage ObjectPredict language per word

Language Object

Probabilities for 140 languages:

KEYTYPEDESCRIPTION
dafloatDanish
defloatGerman
enfloatEnglish
esfloatSpanish
fifloatFinnish
frfloatFrench
hufloatHungarian
itfloatItalian
kkfloatKazakh
nlfloatDutch
nofloatNorwegian
ptfloatPortuguese
rufloatRussian
svfloatSwedish
trfloatTurkish
...float...

For a demo of language check out our tutorial 👨🏻‍💻

Emoticon

Lists all emoticons found.

KEYTYPEDESCRIPTION
confidencefloatConfidence in value matching
emoticonEmoticon Objectboolean values for matched emoticons

Emoticon Object

KEYTYPECONSTRAINTS
Thappyint0 or 1
angelint0 or 1
cryint0 or 1
devilint0 or 1
embarrassedint0 or 1
happyint0 or 1
hesitantint0 or 1
horrorint0 or 1
indecisionint0 or 1
kissint0 or 1
lolint0 or 1
loveint0 or 1
mutedint0 or 1
notloveint0 or 1
playfulint0 or 1
sadint0 or 1
surpriseint0 or 1
very_happyint0 or 1
very_sadint0 or 1
winkint0 or 1

Sentiment

KEYTYPEDESCRIPTIONCONSTRAINTS
positivefloatnormalized addition of all positive sentiment values in the sentence0 <= positive < 1
negativefloatnormalized addition of all negative sentiment values in the sentence-1 < negative <= 0
totalfloatpositive + negative-1 < total < 1

Values are calculated either by using sentiment elements objects if available, or by a prediction model at the subsentence level. Values are normalized to stay in the the [-1 : 1] interval between element, subsentence and sentence level therefore comparisons should be made made with elements of the same depth.

For a demo of sentiment check out our tutorial 👨🏻‍💻

Emotion

KEYTYPEDESCRIPTIONCONSTRAINTS
admirationfloatnormalized total0 <= admiration < 1
amusementfloatnormalized total0 <= amusement < 1
angerfloatnormalized total-1 < anger < 1
annoyancefloatnormalized total-1 < annoyance < 1
caringfloatnormalized total0 < caring < 1
confusionfloatnormalized total-1 < confusion < 1
curiosityfloatnormalized total0 < curiosity < 1
desirefloatnormalized total0 < desire < 1
disappointmentfloatnormalized total-1 < disappointment < 1
disapprovalfloatnormalized total-1 < disapproval < 1
disgustfloatnormalized total-1 < disgust < 1
embarrassmentfloatnormalized total-1 < embarrassment < 1
excitementfloatnormalized total0 < excitement < 1
fearfloatnormalized total-1 < fear < 1
gratitudefloatnormalized total0 <= gratitude < 1
grieffloatnormalized total0 <= grief < 1
happinessfloatnormalized total0 <= happiness < 1
lovefloatnormalized total0 <= love < 1
nervousnessfloatnormalized total-1 <= nervousness < 1
optimismfloatnormalized total0 < optimism < 1
pridefloatnormalized total0 <= pride < 1
realizationfloatnormalized total0 <= realization < 1
relieffloatrelief0 <= relief < 1
remorsefloatnormalized total-1 <= remorse < 1
sadnessfloatnormalized total0 <= sadness < 1
surprisefloatnormalized total-1 < surprise < 1

Values are calculated by using emotion elements objects. Values are normalized to stay in the the [-1 : 1] interval between element, subsentence and sentence level therefore comparisons should be made made with elements of the same depth.

For a demo of emotion check out our tutorial 👨🏻‍💻

Sentences

KeyTypeDescription
sentencesstringlist of sentence

project_ID

KeyTypeDescription
project idintegerproject ID used for analysis

API_version

KeyTypeDescription
API_versionintegerversion of the API