The first thing you need to do before getting your Sentiment Analysis is to process your audio, video or text file. This code is taken directly from our POST Video URL page. If you want to use an audio or text file you can use the code from the POST Audio URL or POST Text File pages.
While we provide you with a default video URL, you can replace that with any other video URL.
In the response above, you will notice the
conversationId field. Using the
conversationId you can send a request to GET Speech to Text endpoint in the Conversation API. Sentiment Analysis also works with the GET Topics endpoint. **In order to get the Sentiment Analysis from the endpoint you must pass the query parameter
sentiment=true in the Conversation API URL. Below is an example
In the response you'll noitice the polaritgy field which shows the intensity of the sentiment. It rnages from -1.0 to 1.0, where -1.0 is the most negative sentiment and 1.0 is the most positive sentiment.
We have chosen the below polarity ranges wrt sentiment type which covers a wide range of conversations. Polarity Sentiment may vary for your use case. We recommend that you define a threshold that works for you, and then adjust the threshold after testing and verifying the results.
|-1.0 => x > -0.3||negative|
|-0.3 => x <= 0.3||neutral|
|0.3 < x <= 1.0||positive|