raffasciuto/map-accent-emotion
0
Accent + emotion analysis backend
Real, measured signals for the "Who Speaks AI?" project — no fabricated numbers.
What it does
- Accent: runs SpeechBrain's CommonAccent classifiers (Zuluaga-Gomez et al., Interspeech 2023). Trained models exist for exactly four languages — English (16 accents, 87% published accuracy), Spanish (6 accents, 68.5%), German (4 variants, 75.5%), Italian (5 dialects, accuracy not published). Any other detected language is deliberately forced through the English model anyway rather than skipped — there is no graceful "not covered" fallback. That forced mismatch is a real, reproducible model output, and it's the point: the system doesn't fail quietly, it fails confidently, defaulting to English.
- Emotion: runs emotion2vec+ (9 classes: angry, disgusted, fearful, happy, neutral, other, sad, surprised, unknown). No published accuracy exists for this model — that absence is itself worth stating plainly, not hiding.
API
POST /analyze — multipart form: file (audio blob), language (ISO 639-1 code, e.g. en, hi, de).
Returns:
{
"accent": {
"top": "string",
"confidence": 0.0,
"distribution": [{ "label": "string", "confidence": 0.0 }],
"modelUsed": "en|es|de|it",
"modelAccuracy": 0.87,
"coverage": true
},
"emotion": {
"top": "string",
"confidence": 0.0,
"distribution": [{ "label": "string", "confidence": 0.0 }]
}
}coverage: false means the language had no trained accent model and was forced through the English one — modelUsed will read "en" in that case regardless of what was actually spoken.
GET /health — also doubles as the cold-start wake-up ping fired from the client on page load.
A Gradio UI is also mounted at / for manual testing / live demoing.
