Skip to main content

Sentiment analysis

AssemblyAI offers a cutting-edge Sentiment Analysis model that can detect the sentiment of each sentence spoken in audio files. When you enable it, you can get a detailed analysis of the positive, negative, or neutral sentiment conveyed in the audio, along with a confidence score for each result.

You can also learn the content on this page from Sentiment Classification for Audio Files in Python on AssemblyAI's YouTube channel.

Quickstart

In the submitting files for transcription guide, include the sentiment_analysis parameter in your request body and set it to true.

You can also view the transcription source code here.

Understanding the response

The sentiment_analysis_results key contains a list of results that provide a detailed breakdown of the sentiment for each sentence in the transcript, including the sentiment label, confidence score, start and end times, and speaker label, if enabled.

The confidence score is an important metric that indicates the level of certainty the model has in its prediction. A higher confidence score indicates that the model is more certain about its prediction, while a lower score indicates that the model is less certain. It's important to consider it when interpreting results, as it can provide insight into the reliability of the analysis.

Troubleshooting

What if the model predicts the wrong sentiment label for a sentence?

The Sentiment Analysis model is based on the interpretation of the transcript and may not always accurately capture the intended sentiment of the speaker. It is recommended to take into account the context of the transcript and to validate the sentiment analysis results with human judgment when possible.

What if the transcript contains sensitive or offensive content?

The Content Moderation model can be used to identify and filter out sensitive or offensive content from the transcript.

What if the sentiment analysis results are not consistent with my expectations?

It's important to ensure that the audio being analyzed is relevant to your use case. Additionally, it's recommended to take into account the context of the transcript and to evaluate the confidence score for each sentiment label.

What if the sentiment analysis is taking too long to process?

The Sentiment Analysis model is designed to be fast and efficient, but processing times may vary depending on the size of the audio file and the complexity of the language used. If you experience longer processing times than expected, don't hesitate to contact our support team.