## Receiving Emotional Intelligence Data

To obtain emotional intelligence data using the V‑Blaze REST API or the V‑Cloud API, add a new form field to your POST using the name “emotion” with the value “true”.

For example, using the “curl” command-line tool, you would include the parameter -F “emotion=true”. In order to submit the file test.wav for translation with emotion results, use a command like:

curl -F "emotion=true" -F "file=@test.wav" -XPOST http://server:17171/STREAM

where server should be replaced by the name or IP address of the translation server. This will print a JSON data structure on your terminal, so it's normally a good idea to direct it to a file. For instance the command below will put a file called test.json in the current directory.

curl -F "emotion=true" ... > test.json

These commands apply to all common operating systems, including Windows, Mac, and various forms of Linux. They are intended to be entered in a terminal or command window.

If you know ahead of time that emotional intelligence will always be required, you can request that Voci supports the configuration of your Web API or cloud interface with emotion enabled by default. You can also send a message to support@vocitec.com to have the default changed. In this case, you would not need to add -F “emotion=true” to your commands.

The method described above will include emotional intelligence data in the JSON output file that is returned from the transcription server. Each transcribed utterance will have its own emotion value. Emotion values are one of the following:

• Positive: Only positive emotions or sentiments were detected.

• Mostly Positive: Most emotion and sentiment values were positive but some negative values were also present.

• Neutral: No emotions or sentiments were detected, or the numbers of positive and negative sentiment-bearing phrases were equal.

• Mostly Negative: Most emotion and sentiment values were negative but some positive values were also present.

• Negative: Only negative emotions or sentiments were detected.

Consider an example consisting of the following statements, “The matter was resolved in a very professional manner. Your employees are very good.” The JSON data returned by the transcription server begins like this:

{
"emotion": "Positive",
"source": "sample1.wav",
"confidence": 0.8, 5 "utterances": [
{
"emotion": "Positive",
"confidence": 0.8,
"end": 6.48,
"sentiment": "Positive",
"sentimentex": [
[ 3, 0 ],
[ [ "+", 1, [ 1, 4 ] ],
[ "+", 1, [ 6, 9 ] ],
[ "+", 1, [ 10, 14 ] ] ]
],
"start": 0,
"recvdate": "2015-05-20 11:35:46.907486",
"events": [
{
"confidence": 0.63,
"end": 0.66,
"start": 0.55,
"word": "The"
},
{
"confidence": 0.61,
"end": 1.02,
"start": 0.66,
"word": "matter"
},
 The first occurrence of emotion is the overall emotion for the file, "Positive" in this case. This overall rating will be included only if all utterances in the file have the same value. For this simple example, there was only one utterance. The sentimentex (sentiment extension) entry indicates the sentiment value of phrases in the transcribed text. The section is a series of lists. Note the first in a series of lists in the sentimentex entry; this first list contains the number of positive phrases (3) followed by the number of negative phrases (0) The other lists in the remainder of the sentimentex entry indicate the location of sentiment-bearing phrases in the text. For example, this line ([ "+", 1, [ 6, 9 ] ],)indicates the following:The “+” indicates that this is a positive phrase. If it had been negative, “-” would appear instead.The 1 indicates the weight of the phrase. This value is not currently used and will always be 1.The 6 and 9 indicate the index of the first word in the phrase and the index of the first word after the phrase. (Note that the first word is counted as index 0.) This means that the phrase will consist of 3 = 9 – 6 words.