Sentiment Analysis
Sentiment analysis automatically detects the emotional tone of transcribed content using AI intelligence. It classifies text as positive, negative, or neutral, and provides a confidence score indicating the strength of the sentiment.
How to Enable
"enable_sentiment_analysis": "true"During Transcription
Parameters
enable_sentiment_analysis(required): Set to "true"
Request
Don’t forget to replace YOUR_API_KEY with your own secret key.
import requests
url = "https://tb2.shunyalabs.ai/v1/transcriptions"
headers = {"X-API-Key": "your-api-key"}
with open("customer_feedback.wav", "rb") as f:
files = {"file": f}
data = {
"enable_sentiment_analysis": "true"
}
response = requests.post(
url,
headers=headers,
files=files,
data=data
)
print(response.json())Example Output
{
"success": true,
"text": "I absolutely love this product! The customer service team was incredibly helpful and resolved my issue within minutes. This is exactly what I was looking for.",
"segments": [...],
"sentiment": {
"sentiment": "positive",
"score": 0.92
}
}Standalone Sentiment Analysis
Parameters
text(required): Input text to analyze
Request
Don’t forget to replace YOUR_API_KEY with your own secret key.
import requests
url = "https://tb.shunyalabs.ai/v1/sentiment"
headers = {"X-API-Key": "your-api-key"}
data = {
"text": "I'm extremely frustrated with this service. I've been waiting for three weeks and still haven't received any response."
}
response = requests.post(url, headers=headers, data=data)
print(response.json())Example Output
{
"sentiment": "negative",
"score": 0.88
}Understanding Sentiment Scores
score (0.0 – 1.0) indicates confidence in the sentiment classification.
- Scores > 0.8: High confidence
- Scores 0.6 – 0.8: Moderate confidence
- Scores < 0.6: Lower confidence (mixed or ambiguous sentiment)
Best Practices
- Provide sufficient context (avoid very short inputs)
- Mixed emotions often result in neutral sentiment
- Best used for overall tone, not word-by-word analysis
- Combine with intent detection for deeper insights
Use Cases
- Customer satisfaction monitoring in support calls
- Brand and product review analysis
- Employee engagement and feedback analysis
- Market research and focus groups
- Quality assurance and risk detection
- Tracking reactions to product launches