Speaker Intelligence

Sentiment Analysis

Analyses the sentiment of the full transcript using Gemini. Returns label, numeric score (-1 to 1), and explanation.


Python SDK

python
config = TranscriptionConfig(
    model="zero-indic",
    enable_sentiment_analysis=True,
)
result = await client.asr.transcribe("feedback.wav", config=config)

s = result.nlp_analysis.sentiment
print(f"{s.label} | score: {s.score}")
# negative | score: -0.72
print(s.explanation)
# Customer expresses frustration about the vehicle being stranded.

REST API

terminal
curl -X POST https://asr.shunyalabs.ai/v1/audio/transcriptions \
  -H "Authorization: Bearer <API_KEY>" \
  -F "[email protected]" \
  -F "model=zero-indic" \
  -F "enable_sentiment_analysis=true"

Output

json
{
  "nlp_analysis": {
    "sentiment": {
      "label": "negative",
      "score": -0.72,
      "explanation": "Customer expresses frustration about the vehicle being stranded."
    }
  }
}