SATI API

The SATI API enables to perform Sentiment Analysis from Textual Information. It is accessed through HTTP GET requests. The format of requests is: http://hostname/empathic?QUERY, where QUERY is formatted as parameter/value pairs separated by the & character. See Query String. For instance http://talc2.loria.fr/empathic?text=I+love+apples&type=emotion will perform the analysis of the sentence "I love apples" using the best emotion engine and return the value "joy". The available parameters are described on this page. All parameters name and values are case independent with the exception of the text parameter whose value is case dependent. All parameters have a default value which is used if the parameter is not provided or if its value is invalid. An example of use of the SATI API can be found on the page SATI Gauge Mobile example in which the API is accessed with javascript and ajax queries. Note that the SATI API is a work in progress, the parameters and the formats are subject to change.

Parameters

text

name
text
description
the text parameter specifies the input text that is to be analyzed. The text value needs to be formatted using the URL encoding. See also RFC 3986. Note that if the text parameter is missing, the engine returns a default emotion.
type
string

lang

name
lang
description
the lang parameter specify the input text language as standardized by the ISO 639-1.
type
string
default
auto

engine

name
engine
description
the engine parameter specifies which sentiment analysis engine will be used for sentiment analysis. Different engines may have different kinds of outputs. See the EmotionML vocabulary document for getting the types of vocabulary used by each engine. Alternatively you can use the type parameter.
type
string
values
metaverse,syntactic_liu_urban,valence_emotion,syntactic_mpqa
default
metaverse

output

name
output
description
the output parameter specifies how the output will be formatted. The "value" output is the simplest format: for engines that return valence information it returns a real value between 0 and 1, 1 being positive, 0 negative and 0.5 neutral. For engines that return emotion information it returns a value defined in a set of values that depends on the engine, for instance the metaverse engine returns a value in {joy, sadness, fear, disgust, ...}. The "xml" output corresponds to a XML representation of the emotion in the EmotionML format. The "json" output corresponds to the same content than the XML representation but formatted using JSON.
type
string
values
value,xml,json
default
value

query

name
query
description
the query parameter specifies the function of the api that is to be called. The "analysis" query corresponds to the main function that analyzes text. The "info" query returns information about the api formatted in XML. The "vocabularies" query returns the vocabularies used by the engines in EmotionML format.
type
string
values
analysis,info,vocabularies,speech
default
analysis

type

name
type
description
the type parameter enables to specify the type of affective information which is sought, rather than the sentiment engine. SATI selects the best engine given the type parameter. If both are provided, the type parameter is discarded.
type
string
values
valence,emotion,valence_emotion
default
valence

twitter

name
twitter
description
the twitter parameter enables to perform the analysis of tweets that contain the given text. If true, it returns the sentiment analysis of the first found tweet containing the text as provided with the text parameter. Since this query waits for a tweet to be published in real time, it is better to call it asychronously with AJAX requests.
type
boolean
default
false

multi

name
multi
description
the multi parameter specifies how to handle multiple emotions. If true, the engine returns all found emotions. If false, it only returns the most intense one if there are several found emotions.
type
boolean
default
false

Test it yourself

Contact

The SATI API has been developed in the LORIA/SYNALP team for the Empathic Products project by:
Alexandre Denis - alexandre.denis at loria.fr
Samuel Cruz-Lara - samuel.cruz-lara at loria.fr