Sentiment
Analyze sentiment to view a speaker's expressed feeling or enthusiasm about a specific topic.
To analyze sentiment, Symbl.ai combines the Conversations API Speech-to-Text messages, usually sentences, with Topics. For a given conversation, the Topics algorithm analyzes each message and provides a sentiment polarity score (-1.0 to +1.0) and suggest a sentiment type of positive, neutral, or negative.
Authentication
Before using this API, generate your authentication token (AUTH_TOKEN
) as described in Authenticate.
Speech-to-text and topics requests
Start by processing a conversation. The result is a conversation ID and a raw transcript.
Pass the conversation ID in a Get members request. The response is a transcript formatted to support conversation intelligence.
Pass the conversation ID in a Get topics request, with parameter sentiment=true
.
For Topics level analysis, the sentiment algorithm analyzes the messages and factors in the sentiment for each topic.
API responses
{
"messages": [
{
"id": "6412283618000896",
"text": "Best package for you is $69.99 per month.",
"from": {
"name": "Roger",
"email": "[email protected]"
},
"startTime": "2020-07-10T11:16:21.024Z",
"endTime": "2020-07-10T11:16:26.724Z",
"conversationId": "6749556955938816",
"phrases": [
{
"type": "action_phrase",
"text": "$69.99 per month"
}
],
"sentiment": {
"polarity": {
"score": 0.6
} ]
}
{
"topics": [
{
"id": "5907389282779136",
"text": "interns",
"type": "topic",
"score": 0.7178597920690242,
"messageIds": [
"4600982711304192",
"5487363432120320",
"6109794119188480"
],
"sentiment": {
"polarity": {
"score": 0.389
},
"suggested": "positive"
},
"parentRefs": []
} ]
}
Parameters
Parameter | Description |
---|---|
polarity | The intensity of the sentiment. Intensity ranges from -1.0 to 1.0, where -1.0 is the most negative sentiment and 1.0 is the most positive sentiment. |
suggested | Display the suggested sentiment type of negative, neutral, or positive. |
Suggested sentiment
The sentiment polarity ranges and suggested sentiment types cover a wide range of conversations.
Polarity may vary for your use case. Define a threshold that works for your environment. Then adjust the threshold after testing and verifying results.
Polarity | Suggested Sentiment |
---|---|
-1.0 => x < -0.3 | negative |
-0.3 => x <= 0.3 | neutral |
0.3 > x <= 1.0 | positive |
Updated about 1 year ago