Intent Detection

Intent detection automatically identifies the purpose or category of a conversation using AI intelligence. You can define custom intent categories, and the system will classify the transcription accordingly with a confidence score.

How to Enable

"enable_intent_detection": "true"

During Transcription

Parameters

  • enable_intent_detection (required): Set to "true"
  • intent_choices (optional): JSON array of intent categories (max 5)

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_call.wav", "rb") as f:
    files = {"file": f}
    data = {
        "enable_intent_detection": "true",
        "intent_choices": '["support", "billing", "technical", "sales"]'  # optional
    }

response = requests.post(
    url,
    headers=headers,
    files=files,
    data=data
)

print(response.json())

Example Output

{
  "success": true,
  "text": "Hi, I'm having trouble with my account login. I keep getting an error message when I try to reset my password.",
  "segments": [...],
  "intent": {
    "intent": "technical",
    "confidence": 0.89
  }
}

Standalone Intent Detection

Parameters

  • text (required): Input text to analyze
  • intent_choices (optional): JSON array of intent categories (max 5)

Request

Don’t forget to replace YOUR_API_KEY with your own secret key.
import requests

url = "https://tb.shunyalabs.ai/v1/intent"
headers = {"X-API-Key": "your-api-key"}

data = {
    "text": "I was charged twice for my subscription this month. Can you help me get a refund?",
    "choices": '["support", "billing", "technical", "sales"]'  # optional
}

response = requests.post(url, headers=headers, data=data)
print(response.json())

Standalone Example Output

{
  "intent": "billing",
  "confidence": 0.92
}

Best Practices

  • Limit intent choices to 3–5 categories for best accuracy
  • Use clear, distinct category names
  • Avoid very short or ambiguous input text
  • Confidence scores above 0.8 are generally reliable

Use Cases

  • Customer support call routing (billing, tech, sales)
  • Chatbot and conversational AI analytics
  • Survey and feedback response categorization
  • Meeting, podcast, and interview classification
  • Call center trend and issue analysis