#!/usr/bin/env node 'use strict' const fs = require('node:fs') const path = require('node:path') const DEFAULT_INPUT = 'public/data/predictions.csv' // balanced 39×7=273 clip set const DEFAULT_OUTPUT = 'data/results/track1-analysis-combined.html' // Models to exclude from all reports (kept in raw CSV but not shown) const EXCLUDED_MODELS = new Set(['gemini_audio']) // ── Model metadata ────────────────────────────────────────────────────────── const MODEL_META = { gemini_audio: { displayName: 'Google Gemini 2.5 Flash', shortName: 'Gemini 2.5', providerShort: 'gemini-2.5-flash', cssVar: '--m-gemini', color: '#1d5fa3', }, gemini_3_5_flash: { displayName: 'Google Gemini 3.5 Flash', shortName: 'Gemini 3.5', providerShort: 'gemini-3.5-flash', cssVar: '--m-gemini35', color: '#0b9fd8', }, hume_prosody: { displayName: 'Hume AI Prosody', shortName: 'Hume Prosody', providerShort: 'speech_prosody', cssVar: '--m-hume', color: '#2c7a4e', }, inworld_voice_profile: { displayName: 'Inworld Voice Profile', shortName: 'Inworld Voice', providerShort: 'inworld-stt-1', cssVar: '--m-inworld', color: '#c2541a', }, openai_realtime: { displayName: 'OpenAI Realtime', shortName: 'OpenAI RT', providerShort: 'gpt-realtime-2', cssVar: '--m-openai', color: '#5d4a9a', }, tr_mimo_v2_5: { displayName: 'Xiaomi MiMo v2.5', shortName: 'MiMo v2.5', providerShort: 'xiaomi/mimo-v2.5', cssVar: '--m-mimo', color: '#b5860d', }, tr_nemotron_omni: { displayName: 'NVIDIA Nemotron Omni', shortName: 'Nemotron', providerShort: 'nvidia/nemotron-omni', cssVar: '--m-nemotron', color: '#1a7a6e', }, tr_voxtral_small: { displayName: 'Mistral Voxtral Small', shortName: 'Voxtral', providerShort: 'mistralai/voxtral-small', cssVar: '--m-voxtral', color: '#8b2252', }, tr_qwen3_5_omni_plus: { displayName: 'Alibaba Qwen3.5 Omni+', shortName: 'Qwen3.5', providerShort: 'qwen3.5-omni-plus', cssVar: '--m-qwen', color: '#6b47b8', }, tr_minimax_m3: { displayName: 'MiniMax M3', shortName: 'MiniMax', providerShort: 'MiniMax-M3', cssVar: '--m-minimax', color: '#e05a1e', }, } function getModelMeta(modelKey) { return ( MODEL_META[modelKey] || { displayName: modelKey, shortName: modelKey, providerShort: modelKey, cssVar: '--m-unknown', color: '#888888', } ) } // ── Emotion metadata ──────────────────────────────────────────────────────── const EMO_COLORS = { angry: '#b83320', disgusted: '#7a3d7a', fearful: '#2d4e85', happy: '#9e7515', neutral: '#5a6368', sad: '#2361a0', surprised: '#a05c10', } const VALENCE_MAP = { angry: 'negative', disgusted: 'negative', fearful: 'negative', sad: 'negative', happy: 'positive', neutral: 'neutral', // surprised: excluded from valence } // ── CSV parser ────────────────────────────────────────────────────────────── function parseCsv(text) { const rows = [] let row = [] let value = '' let quoted = false for (let i = 0; i < text.length; i++) { const char = text[i] const next = text[i + 1] if (quoted) { if (char === '"' && next === '"') { value += '"' i++ } else if (char === '"') { quoted = false } else { value += char } continue } if (char === '"') { quoted = true } else if (char === ',') { row.push(value) value = '' } else if (char === '\n') { row.push(value) rows.push(row) row = [] value = '' } else if (char !== '\r') { value += char } } if (value || row.length > 0) { row.push(value) rows.push(row) } const [headers, ...dataRows] = rows.filter((r) => r.some((c) => c !== '')) if (!headers) return [] return dataRows.map((r) => Object.fromEntries(headers.map((h, i) => [h, r[i] || '']))) } // ── Helpers ───────────────────────────────────────────────────────────────── function pct(num, den) { if (!den) return 0 return (num / den) * 100 } function fmtPct(num, den) { if (!den) return 'n/a' return `${pct(num, den).toFixed(1)}%` } function unique(arr) { return [...new Set(arr)].sort() } function deduplicateRows(rows) { // Keep last occurrence of each (model_name, audio_id) pair — re-runs overwrite earlier results const seen = new Map() for (const row of rows) { const key = `${row.model_name}|${row.audio_id}` seen.set(key, row) } return [...seen.values()] } function groupBy(rows, keyFn) { const map = new Map() for (const row of rows) { const key = keyFn(row) if (!map.has(key)) map.set(key, []) map.get(key).push(row) } return map } function escHtml(str) { return String(str ?? '') .replace(/&/g, '&') .replace(//g, '>') } // ── Analytics ──────────────────────────────────────────────────────────────── function analyze(rawRows) { const rows = deduplicateRows(rawRows).filter((r) => !EXCLUDED_MODELS.has(r.model_name)) const audioIds = unique(rows.map((r) => r.audio_id).filter(Boolean)) const modelKeys = unique(rows.map((r) => r.model_name).filter(Boolean)) const emotions = unique(rows.map((r) => r.required_emotion).filter(Boolean)) const scored = rows.filter((r) => !r.error && r.mapped_label) const correct = scored.filter((r) => r.correct === 'true') const errors = rows.filter((r) => r.error) // Per-model summaries const modelSummaries = modelKeys.map((key) => { const mRows = rows.filter((r) => r.model_name === key) const mScored = mRows.filter((r) => !r.error && r.mapped_label) const mCorrect = mScored.filter((r) => r.correct === 'true') const mErrors = mRows.filter((r) => r.error) const meta = getModelMeta(key) // Per-emotion for this model const perEmotion = emotions.map((emo) => { const eRows = mScored.filter((r) => r.required_emotion === emo) const eCorrect = eRows.filter((r) => r.correct === 'true') return { emotion: emo, rows: eRows.length, correct: eCorrect.length, accuracy: pct(eCorrect.length, eRows.length), accuracyStr: fmtPct(eCorrect.length, eRows.length), } }).filter((e) => e.rows > 0) // Confusion analysis for bias section const wrongPredictions = mScored.filter((r) => r.correct !== 'true') // Count predicted labels on wrong rows const predictedCounts = {} for (const row of wrongPredictions) { const lbl = row.mapped_label || row.predicted_label predictedCounts[lbl] = (predictedCounts[lbl] || 0) + 1 } const topOverpredicted = Object.entries(predictedCounts) .sort((a, b) => b[1] - a[1]) .slice(0, 1) .map(([lbl, cnt]) => ({ label: lbl, count: cnt }))[0] || null // Top confusion pairs (required → predicted) for wrong rows const pairCounts = {} for (const row of wrongPredictions) { const pred = row.mapped_label || row.predicted_label const key2 = `${row.required_emotion}→${pred}` pairCounts[key2] = (pairCounts[key2] || 0) + 1 } const topConfusions = Object.entries(pairCounts) .sort((a, b) => b[1] - a[1]) .slice(0, 3) .map(([pair, cnt]) => { const [from, to] = pair.split('→') return { from, to, count: cnt } }) // Most underpredicted (lowest accuracy non-zero-sample emotion) const sortedByAccuracy = [...perEmotion].sort((a, b) => a.accuracy - b.accuracy) const worstEmotion = sortedByAccuracy[0] || null const bestEmotion = [...perEmotion].sort((a, b) => b.accuracy - a.accuracy)[0] || null return { key, meta, rows: mRows.length, scored: mScored.length, correct: mCorrect.length, errors: mErrors.length, accuracy: pct(mCorrect.length, mScored.length), accuracyStr: fmtPct(mCorrect.length, mScored.length), perEmotion, topOverpredicted, topConfusions, worstEmotion, bestEmotion, } }).sort((a, b) => b.accuracy - a.accuracy || a.key.localeCompare(b.key)) // Overall per-emotion const overallEmotions = emotions.map((emo) => { const eRows = scored.filter((r) => r.required_emotion === emo) const eCorrect = eRows.filter((r) => r.correct === 'true') return { emotion: emo, rows: eRows.length, correct: eCorrect.length, accuracy: pct(eCorrect.length, eRows.length), accuracyStr: fmtPct(eCorrect.length, eRows.length), } }).sort((a, b) => a.accuracy - b.accuracy) // Valence analysis const valenceRows = scored.filter((r) => VALENCE_MAP[r.required_emotion] !== undefined) const valenceCategories = ['negative', 'neutral', 'positive'] function valenceOf(emotion) { return VALENCE_MAP[emotion] || null } function predictedValence(mappedLabel) { return VALENCE_MAP[mappedLabel] || null } // Overall valence accuracy by category const valenceByCategory = valenceCategories.map((cat) => { const catRows = valenceRows.filter((r) => valenceOf(r.required_emotion) === cat) const catCorrect = catRows.filter((r) => predictedValence(r.mapped_label) === cat) return { cat, rows: catRows.length, correct: catCorrect.length, accuracy: pct(catCorrect.length, catRows.length), accuracyStr: fmtPct(catCorrect.length, catRows.length) } }) // Overall valence confusion matrix const valenceMatrix = {} for (const actual of valenceCategories) { valenceMatrix[actual] = {} for (const pred of valenceCategories) { valenceMatrix[actual][pred] = 0 } } for (const row of valenceRows) { const actual = valenceOf(row.required_emotion) const pred = predictedValence(row.mapped_label) if (actual && pred) valenceMatrix[actual][pred]++ } // Per-model valence const modelValence = modelSummaries.map((ms) => { const mValRows = valenceRows.filter((r) => r.model_name === ms.key) const mValCorrect = mValRows.filter((r) => predictedValence(r.mapped_label) === valenceOf(r.required_emotion)) const audioCount = unique(mValRows.map((r) => r.audio_id)).length // Per-model valence confusion matrix const mat = {} for (const actual of valenceCategories) { mat[actual] = {} for (const pred of valenceCategories) { mat[actual][pred] = 0 } } for (const row of mValRows) { const actual = valenceOf(row.required_emotion) const pred = predictedValence(row.mapped_label) if (actual && pred) mat[actual][pred]++ } // Per-category accuracy for per-model valence subtitle const catAccuracy = {} for (const cat of valenceCategories) { const catRows = mValRows.filter((r) => valenceOf(r.required_emotion) === cat) catAccuracy[cat] = pct(mat[cat][cat], catRows.length) } return { key: ms.key, meta: ms.meta, rows: mValRows.length, audioCount, correct: mValCorrect.length, accuracy: pct(mValCorrect.length, mValRows.length), accuracyStr: fmtPct(mValCorrect.length, mValRows.length), matrix: mat, catAccuracy, } }).sort((a, b) => b.accuracy - a.accuracy) const valenceAudioCount = unique(valenceRows.map((r) => r.audio_id)).length return { totalRows: rows.length, audioCount: audioIds.length, modelCount: modelKeys.length, emotions, scored: scored.length, correct: correct.length, errors: errors.length, overallAccuracy: pct(correct.length, scored.length), overallAccuracyStr: fmtPct(correct.length, scored.length), modelSummaries, overallEmotions, valenceByCategory, valenceMatrix, modelValence, valenceRows: valenceRows.length, valenceAudioCount, } } // ── HTML generators ────────────────────────────────────────────────────────── function modelCssVars(modelSummaries) { return modelSummaries.map((ms) => ` ${ms.meta.cssVar}: ${ms.meta.color};`).join('\n') } function emoSwatch(emotion, extra = '') { const color = EMO_COLORS[emotion] || '#888' return `` } function modelDot(meta, size = 9) { return `` } function accColorClass(accuracy) { if (accuracy >= 60) return 'acc-great' if (accuracy >= 40) return 'acc-good' if (accuracy >= 25) return 'acc-mid' return 'acc-poor' } function leaderboardTable(modelSummaries) { const rows = modelSummaries.map((ms, i) => { const rankClass = i === 0 ? 'first' : i === 1 ? 'second' : i === 2 ? 'third' : '' const medal = i === 0 ? ' 🥇' : i === 1 ? ' 🥈' : i === 2 ? ' 🥉' : '' return ` ${i + 1} ${escHtml(ms.meta.displayName)} ${escHtml(ms.meta.providerShort)} ${ms.correct.toLocaleString()} / ${ms.scored.toLocaleString()} ${ms.accuracyStr} ` }) return rows.join('\n') } function emotionTableRows(overallEmotions) { return overallEmotions.map((e) => { const color = EMO_COLORS[e.emotion] || '#888' return ` ${escHtml(e.emotion)} ${e.rows.toLocaleString()}${e.correct.toLocaleString()} ${e.accuracyStr} ` }).join('\n') } function biasGrid(modelSummaries) { const cols = modelSummaries.map((ms) => { const topOver = ms.topOverpredicted const topConfusions = ms.topConfusions.slice(0, 3) const worst = ms.worstEmotion const best = ms.bestEmotion const confusionHtml = topConfusions.map((c) => { const toColor = EMO_COLORS[c.to] || '#888' return `
${escHtml(c.from)}${escHtml(c.to)}${c.count}×
` }).join('\n') return `
${escHtml(ms.meta.displayName)}
${escHtml(ms.meta.providerShort)}  ·  overall ${ms.accuracyStr}
Most over-predicted
${escHtml(topOver?.label || 'n/a')}
${topOver ? `${topOver.count} wrong calls to "${escHtml(topOver.label)}"` : '—'}
${confusionHtml}
Weakest emotion
${escHtml(worst?.emotion || 'n/a')}
${worst ? `${worst.accuracyStr} (${worst.correct}/${worst.rows})` : '—'}
Strongest emotion
${escHtml(best?.emotion || 'n/a')}
${best ? best.accuracyStr : '—'}
` }) return cols.join('\n\n') } function modelDetailGrid(modelSummaries) { return modelSummaries.map((ms) => { const sorted = ms.perEmotion.slice().sort((a, b) => b.accuracy - a.accuracy) const bars = sorted.map((e) => { const color = EMO_COLORS[e.emotion] || '#888' const w = e.accuracy.toFixed(1) return `
${escHtml(e.emotion)}
${e.accuracyStr}
` }).join('\n') return `
${modelDot(ms.meta, 10)}${escHtml(ms.meta.displayName)}
${ms.accuracyStr}
${escHtml(ms.meta.providerShort)} · ${ms.correct} / ${ms.scored}
${bars}
` }).join('\n\n') } function valenceLeaderboard(modelValence) { return modelValence.map((mv, i) => { const rankClass = i === 0 ? 'first' : i === 1 ? 'second' : '' return ` ${i + 1} ${escHtml(mv.meta.displayName)} ${escHtml(mv.meta.providerShort)} ${mv.correct.toLocaleString()} / ${mv.audioCount.toLocaleString()} ${mv.accuracyStr} ` }).join('\n') } function valenceMatrixHtml(mat) { const cats = ['negative', 'neutral', 'positive'] return cats.map((actual) => { const total = cats.reduce((sum, pred) => sum + mat[actual][pred], 0) const cells = cats.map((pred) => `${mat[actual][pred].toLocaleString()}`).join('') return ` ${actual}${cells}${total.toLocaleString()}` }).join('\n') } function perModelValenceGrid(modelValence) { const cats = ['negative', 'neutral', 'positive'] return modelValence.map((mv) => { const rows = cats.map((actual) => { const total = cats.reduce((sum, pred) => sum + mv.matrix[actual][pred], 0) const acc = mv.catAccuracy[actual] const cells = cats.map((pred) => `${mv.matrix[actual][pred]}`).join('') return ` ${actual} (${acc.toFixed(1)}%)${cells}${total}` }).join('\n') return `
${modelDot(mv.meta, 10)}${escHtml(mv.meta.displayName)}
${mv.accuracyStr}
${escHtml(mv.meta.providerShort)} · ${mv.correct} / ${mv.audioCount}
${rows}
Actual \\ PredictedNegativeNeutralPositiveTotal
` }).join('\n\n') } // ── Chart JS data ──────────────────────────────────────────────────────────── function chartScript(analysis) { const { modelSummaries, overallEmotions } = analysis const emotions = overallEmotions.map((e) => e.emotion) const modelNames = modelSummaries.map((ms) => ms.meta.displayName) const modelColors = modelSummaries.map((ms) => ms.meta.color) const modelDataObj = Object.fromEntries( modelSummaries.map((ms) => { const byEmo = Object.fromEntries(ms.perEmotion.map((e) => [e.emotion, e.accuracy])) const data = emotions.map((emo) => Number((byEmo[emo] || 0).toFixed(1))) return [ms.meta.displayName, data] }) ) const emotionAccuracies = overallEmotions.map((e) => Number(e.accuracy.toFixed(1))) const emotionColors = overallEmotions.map((e) => EMO_COLORS[e.emotion] || '#888') const correctCount = analysis.correct const incorrectCount = analysis.scored - analysis.correct return `` } // ── Main HTML builder ──────────────────────────────────────────────────────── function buildHtml(analysis, inputPath) { const { totalRows, audioCount, modelCount, scored, correct, errors, overallAccuracyStr, modelSummaries, overallEmotions, valenceByCategory, valenceMatrix, modelValence, valenceRows, valenceAudioCount, } = analysis const sortedByAcc = [...modelSummaries] // already sorted desc const best = sortedByAcc[0] const worst = sortedByAcc[sortedByAcc.length - 1] const hardestEmo = overallEmotions[0] const easiestEmo = overallEmotions[overallEmotions.length - 1] const today = new Date().toLocaleDateString('en-US', { year: 'numeric', month: 'long', day: 'numeric' }) const modelCountStr = `${modelCount} Models Evaluated` const radarLegend = modelSummaries.map((ms) => `
${escHtml(ms.meta.displayName)} — ${ms.accuracyStr}
` ).join('\n') const vNegRow = valenceByCategory.find((v) => v.cat === 'negative') const vPosRow = valenceByCategory.find((v) => v.cat === 'positive') const vNeuRow = valenceByCategory.find((v) => v.cat === 'neutral') const valByCatRows = valenceByCategory.map((v) => { const color = v.cat === 'negative' ? 'var(--red)' : v.cat === 'positive' ? 'var(--emo-happy)' : 'var(--emo-neutral)' return ` ${v.cat}${v.rows.toLocaleString()}${v.correct.toLocaleString()}${v.accuracyStr}` }).join('\n') // CSS vars for models const modelVars = modelSummaries.map((ms) => ` ${ms.meta.cssVar}: ${ms.meta.color};`).join('\n') return ` Speech Emotion Recognition Benchmark — Combined
2026 · ${modelCount} Models Evaluated — Combined Run

Speech Emotion
Recognition
Benchmark

Generated ${today}
${audioCount.toLocaleString()} audio files · 7 emotion labels
${modelCount} models evaluated

TL;DR
We benchmarked ${modelCount} production speech-emotion AI models on a balanced set of 273 real human voice recordings across 7 emotions. The best model hit ${best.accuracyStr} — barely above chance on the hardest emotions.
No model exceeds ${best.accuracyStr} accuracy on a balanced 7-class task. Random baseline is 14.3%.
${easiestEmo.emotion.charAt(0).toUpperCase() + easiestEmo.emotion.slice(1)} is reliably detected (${easiestEmo.accuracyStr}). ${hardestEmo.emotion.charAt(0).toUpperCase() + hardestEmo.emotion.slice(1)} is nearly invisible (${hardestEmo.accuracyStr}).
Almost every model is biased toward predicting "neutral" — a safe default that inflates overall accuracy but fails in practice.
Standard speech pipelines transcribe first, then process text — discarding all prosodic signal. A dedicated SER model must run at the audio stage.

Why speech emotion detection matters for AI agents

Most AI voice agents today use a cascading architecture: audio is first converted to text by a speech-to-text model, then that transcript is passed to an LLM to generate a response. This pipeline is fast and effective — but it silently discards something critical.

When audio becomes text, all prosodic information is lost: tone, pitch, tempo, tremor, and vocal energy that carry emotional meaning are stripped away. The LLM downstream only sees words. A customer saying "I'm fine" in a frustrated, clipped voice looks identical to one saying it calmly.

If you want your agent to respond differently based on how a customer feels — escalating to a human when someone sounds distressed, adjusting tone when frustration is detected, or personalizing a response when someone sounds excited — you need a dedicated speech emotion recognition model running on the raw audio, before transcription.

This benchmark exists to answer the practical question: which models are actually good enough to rely on in production?

The core problem
"I'm fine." — spoken calmly vs. spoken through tears. The transcript is identical. The emotional signal is not.
Cascading pipeline
AudioRaw speech with emotional signal
SER model here← only chance to read emotion
STTTranscript — emotion gone
LLMResponse generation

What we're evaluating

We evaluate ${modelCount} production speech-emotion APIs on 273 real human voice recordings — not acted speech from professional voice actors. Speakers were asked to read emotionally neutral scripts (the content carries no inherent emotion) while expressing a target emotion purely through vocal delivery.

This design isolates prosody from semantics: the only signal available to each model is how something is said, not what is said. It reflects the hardest and most realistic version of the problem.

The dataset is balanced: exactly 39 clips per emotion, so accuracy metrics are not skewed by class frequency. We report macro accuracy (the mean of per-emotion accuracies) as the primary metric.

Track 1 — 7-class emotion
Angry · Disgusted · Fearful · Happy · Neutral · Sad · Surprised
The full discrete emotion task. Each model must classify a clip into one of seven categories. Baseline random accuracy: 14.3%.
Track 2 — 3-class valence
Positive · Neutral · Negative
Emotions collapsed to sentiment polarity. Surprised clips are excluded (ambiguous valence). Baseline random accuracy: 33.3%. See Section 07 for results.
Dataset
273 clips · 7 emotions · Real speakers
Balanced evaluation set sampled from ${audioCount.toLocaleString()} total recordings. All speakers consented to public release. Scripts were emotionally neutral by design.

${modelCount} speech-emotion models were tested across ${scored.toLocaleString()} scored clips. The best achieved ${best.accuracyStr} overall accuracy, while ${hardestEmo.emotion} remained the hardest emotion to detect — ${hardestEmo.accuracyStr} overall.

${overallAccuracyStr}
Overall accuracy across all models and emotions. ${correct.toLocaleString()} correct of ${scored.toLocaleString()} scored rows.
${easiestEmo.accuracyStr}
Best emotion — ${easiestEmo.emotion}, the category where models performed most reliably.
${hardestEmo.accuracyStr}
Worst emotion — ${hardestEmo.emotion}, only ${hardestEmo.correct.toLocaleString()} of ${hardestEmo.rows.toLocaleString()} examples correctly identified.

01 Model Leaderboard
${leaderboardTable(modelSummaries)}
Model Provider Correct Accuracy

Overall · Correct vs Incorrect

${Math.round(analysis.overallAccuracy)}% Accurate
  • Correct ${correct.toLocaleString()}
  • Incorrect ${(scored - correct).toLocaleString()}

02 Emotion Difficulty — Hardest to Easiest
${emotionTableRows(overallEmotions)}
Emotion Sample size Correct Accuracy

03 Model Accuracy by Emotion

04 Strength Profile — All Models

The radar reveals cross-model patterns: which emotions each model handles well versus where they all collapse. Compare how newer models like ${modelSummaries[0]?.meta.displayName || 'the top model'} differ from established ones across the emotion spectrum.

Models
${radarLegend}

05 Prediction Bias — What Each Model Gets Wrong
${biasGrid(modelSummaries)}

06 Per-Model Detail
${modelDetailGrid(modelSummaries)}

07 Results & Key Takeaways
01
No model is production-ready for all emotions
The best model (${escHtml(best?.meta.displayName || '')}) hits ${best?.accuracyStr} macro accuracy — about 3× random chance. But performance varies wildly by emotion: neutral detection is reliable, while fearful and disgusted hover near chance for most models.
02
Every model defaults to "neutral"
Across all ${modelCount} models, the single most common error is predicting neutral when the true label is something else. This is a safe hedge that inflates performance on neutral-heavy datasets — but fails on the emotions that matter most in customer-facing applications.
03
Gemini leads, but the gap is narrow
Google Gemini 3.5 Flash leads at ${best?.accuracyStr}, closely followed by Gemini 2.5 Flash and Hume AI Prosody. The top 4 models are within 6 percentage points of each other — meaning model choice alone is not a silver bullet.
04
Different models fail in different ways
Hume Prosody uniquely excels at happy (64%) but scores 0% on fearful. Mistral Voxtral leads on disgusted (74%) but collapses on angry (16%). Inworld Voice tops neutral accuracy (96%) but barely registers surprised (4%). Ensemble approaches may outperform any single model.
05
Valence is more tractable than discrete emotion
Collapsing to 3-class valence (positive / neutral / negative) significantly improves accuracy. ${escHtml(modelValence[0]?.meta.displayName || '')} reaches ${modelValence[0]?.accuracyStr} on the valence task vs. ${best?.accuracyStr} on the 7-class task. For many agent use cases, valence alone may be sufficient.
06
Content-neutral scripts are harder than expected
Our scripts were intentionally emotionally ambiguous in wording — no emotional vocabulary, no dramatic events. Models that rely on semantic cues from transcription cannot use them here. The signal is purely prosodic, which is the exact condition these models will face in production on real customer calls.

08 Valence Analysis — Positive / Neutral / Negative

Emotions collapsed to 3-class valence: positive (happy), negative (angry, disgusted, fearful, sad), neutral. Clips with a gold label of surprised are excluded. Predicted surprised on remaining clips counts as incorrect. Evaluated across ${valenceAudioCount.toLocaleString()} audio files · ${valenceRows.toLocaleString()} scored rows.

${valenceLeaderboard(modelValence)}
RankModelProvider modelCorrect / FilesAccuracy
Accuracy by Gold Category (all models)
${valByCatRows}
CategoryRowsCorrectAccuracy
Overall Confusion Matrix
${valenceMatrixHtml(valenceMatrix)}
Actual \\ PredictedNegativeNeutralPositiveTotal
${perModelValenceGrid(modelValence)}

${chartScript(analysis)} ` } // ── Entry point ────────────────────────────────────────────────────────────── function parseArgs(argv) { const args = { input: DEFAULT_INPUT, output: DEFAULT_OUTPUT } for (let i = 2; i < argv.length; i++) { if (argv[i] === '--input' && argv[i + 1]) { args.input = argv[++i] } else if (argv[i] === '--out' && argv[i + 1]) { args.output = argv[++i] } else if (argv[i] === '--help' || argv[i] === '-h') { console.log(`Usage: node scripts/analyze-track1-combined.cjs [--input ] [--out ]`) process.exit(0) } } return args } function main() { const args = parseArgs(process.argv) const inputPath = path.resolve(args.input) const outputPath = path.resolve(args.output) console.log(`Reading: ${inputPath}`) const rows = parseCsv(fs.readFileSync(inputPath, 'utf8')) console.log(`Parsed ${rows.length} rows`) const analysis = analyze(rows) const html = buildHtml(analysis, args.input) fs.mkdirSync(path.dirname(outputPath), { recursive: true }) fs.writeFileSync(outputPath, html, 'utf8') console.log(`Written: ${outputPath}`) console.log(JSON.stringify({ audioFiles: analysis.audioCount, models: analysis.modelCount, totalRows: analysis.totalRows, scored: analysis.scored, correct: analysis.correct, errors: analysis.errors, overallAccuracy: analysis.overallAccuracyStr, topModel: analysis.modelSummaries[0]?.meta.displayName, topModelAccuracy: analysis.modelSummaries[0]?.accuracyStr, }, null, 2)) } main()