Spaces:
Sleeping
Sleeping
Update public/index.html
Browse files- public/index.html +21 -28
public/index.html
CHANGED
|
@@ -81,7 +81,9 @@
|
|
| 81 |
|
| 82 |
.controls { background: #f8fafc; padding: 20px; border-radius: 12px; display: flex; gap: 20px; align-items: center; margin-bottom: 20px; flex-wrap: wrap; }
|
| 83 |
select { padding: 10px; border-radius: 8px; border: 1px solid #cbd5e1; font-size: 14px; min-width: 250px; cursor:pointer; }
|
|
|
|
| 84 |
.rank-info { font-size: 13px; color: #64748b; margin-top: 5px; font-style: italic; }
|
|
|
|
| 85 |
|
| 86 |
/* Table */
|
| 87 |
.table-wrap { overflow-x: auto; border: 1px solid #e2e8f0; border-radius: 12px; margin-bottom: 30px; }
|
|
@@ -103,6 +105,9 @@
|
|
| 103 |
|
| 104 |
.footer { text-align: center; padding: 40px; color: #94a3b8; font-size: 14px; }
|
| 105 |
@keyframes fadeIn { from{opacity:0; transform:translateY(10px)} to{opacity:1; transform:translateY(0)} }
|
|
|
|
|
|
|
|
|
|
| 106 |
</style>
|
| 107 |
</head>
|
| 108 |
<body>
|
|
@@ -300,23 +305,17 @@
|
|
| 300 |
|
| 301 |
modelStats.sort((a,b) => (a.wer - b.wer) || (a.cer - b.cer)); // Sorting by WER then CER
|
| 302 |
|
| 303 |
-
html = `<
|
|
|
|
| 304 |
modelStats.forEach((m, i) => {
|
| 305 |
let rank = 1;
|
| 306 |
if (i > 0 && Math.abs(m.wer - modelStats[i-1].wer) > 0.001) rank = i + 1;
|
| 307 |
-
else if (i > 0) rank = 1;
|
| 308 |
-
|
| 309 |
-
|
| 310 |
-
|
| 311 |
let icon = '';
|
| 312 |
-
|
| 313 |
-
// Let's just use top 3 logic based on sorted order for simplicity or strict rank variable.
|
| 314 |
-
// Strict Rank Variable:
|
| 315 |
-
if(i===0) m.rank=1;
|
| 316 |
-
else if(Math.abs(m.wer - modelStats[i-1].wer) < 0.001) m.rank = modelStats[i-1].rank;
|
| 317 |
-
else m.rank = i+1;
|
| 318 |
-
|
| 319 |
-
if(m.rank === 1) icon = 'π₯ '; else if(m.rank === 2) icon = 'π₯ '; else if(m.rank === 3) icon = 'π₯ ';
|
| 320 |
|
| 321 |
html += `<tr><td style="font-weight:600; color:var(--simba-navy)">${icon}${m.name}</td><td><b>${fmt(m.wer)} / ${fmt(m.cer)}</b></td></tr>`;
|
| 322 |
});
|
|
@@ -332,12 +331,12 @@
|
|
| 332 |
|
| 333 |
d.data.sort((a,b) => a.Avg_WER - b.Avg_WER);
|
| 334 |
|
| 335 |
-
html = `<
|
|
|
|
| 336 |
d.languages.forEach(l => html += `<th>${getIso(l.name, l.iso)}</th>`);
|
| 337 |
html += `</tr></thead><tbody>`;
|
| 338 |
|
| 339 |
d.data.forEach((r, idx) => {
|
| 340 |
-
// Rank Logic
|
| 341 |
if(idx===0) r.rank=1;
|
| 342 |
else if(Math.abs(r.Avg_WER - d.data[idx-1].Avg_WER) < 0.001) r.rank = d.data[idx-1].rank;
|
| 343 |
else r.rank = idx+1;
|
|
@@ -413,23 +412,20 @@
|
|
| 413 |
function renderLanguageView() {
|
| 414 |
const lang = document.getElementById('lang-select').value;
|
| 415 |
|
| 416 |
-
// 1. ASR
|
| 417 |
let asrRows = [];
|
| 418 |
Object.keys(DATA.asr.by_model).forEach(modName => {
|
| 419 |
const row = DATA.asr.by_model[modName].find(r => r.Language === lang);
|
| 420 |
if(row) asrRows.push({model: modName, wer: row.WER, cer: row.CER});
|
| 421 |
});
|
| 422 |
-
|
| 423 |
-
// Sort: Primary WER ASC, Secondary CER ASC
|
| 424 |
asrRows.sort((a,b) => (a.wer - b.wer) || (a.cer - b.cer));
|
| 425 |
|
| 426 |
-
let h1 = `<table><thead><tr><th>Model</th><th>WER</th><th>CER</th></tr></thead><tbody>`;
|
| 427 |
if(asrRows.length === 0) h1 += `<tr><td colspan="3">No ASR data for this language.</td></tr>`;
|
| 428 |
else {
|
| 429 |
asrRows.forEach((r, i) => {
|
| 430 |
-
// Calculate Rank
|
| 431 |
if(i===0) r.rank=1;
|
| 432 |
-
else if(Math.abs(r.wer - asrRows[i-1].wer) < 0.001) r.rank = asrRows[i-1].rank;
|
| 433 |
else r.rank = i+1;
|
| 434 |
|
| 435 |
let icon = '';
|
|
@@ -440,7 +436,7 @@
|
|
| 440 |
h1 += `</tbody></table>`;
|
| 441 |
document.getElementById('lang-asr-table').innerHTML = h1;
|
| 442 |
|
| 443 |
-
// 2. TTS
|
| 444 |
let h2 = `<table><thead><tr><th>Model</th>
|
| 445 |
<th>WER(β)</th><th>MCD(β)</th><th>LogF0(β)</th><th>SpTok(β)</th>
|
| 446 |
<th>PESQ(β)</th><th>UTMOS(β)</th><th>SpBLEU(β)</th><th>SpBERT(β)</th>
|
|
@@ -464,20 +460,17 @@
|
|
| 464 |
h2 += `</tbody></table>`;
|
| 465 |
document.getElementById('lang-tts-table').innerHTML = h2;
|
| 466 |
|
| 467 |
-
// 3. SLID
|
| 468 |
-
let h3 = `<table><thead><tr><th>Model</th><th>F1-Score</th></tr></thead><tbody>`;
|
| 469 |
-
// Fuzzy match logic
|
| 470 |
const slidRow = DATA.slid.find(r => r.Language === lang) ||
|
| 471 |
DATA.slid.find(r => r.Language.startsWith(lang + " (")) ||
|
| 472 |
DATA.slid.find(r => r.Language.includes(lang));
|
| 473 |
|
| 474 |
if(slidRow) {
|
| 475 |
-
// Extract models dynamically (exclude Language key)
|
| 476 |
const models = Object.keys(slidRow).filter(k => k !== 'Language' && k !== 'ISO');
|
| 477 |
-
const scores = models.map(m => ({n: m, v: slidRow[m]})).sort((a,b) => b.v - a.v);
|
| 478 |
|
| 479 |
scores.forEach((sc, i) => {
|
| 480 |
-
// Rank logic for SLID
|
| 481 |
if(i===0) sc.rank=1;
|
| 482 |
else if(Math.abs(sc.v - scores[i-1].v) < 0.001) sc.rank = scores[i-1].rank;
|
| 483 |
else sc.rank = i+1;
|
|
|
|
| 81 |
|
| 82 |
.controls { background: #f8fafc; padding: 20px; border-radius: 12px; display: flex; gap: 20px; align-items: center; margin-bottom: 20px; flex-wrap: wrap; }
|
| 83 |
select { padding: 10px; border-radius: 8px; border: 1px solid #cbd5e1; font-size: 14px; min-width: 250px; cursor:pointer; }
|
| 84 |
+
|
| 85 |
.rank-info { font-size: 13px; color: #64748b; margin-top: 5px; font-style: italic; }
|
| 86 |
+
.score-desc { font-size: 14px; color: #475569; background: #fff7ed; border-left: 4px solid #f97316; padding: 10px 15px; margin-bottom: 20px; border-radius: 4px; }
|
| 87 |
|
| 88 |
/* Table */
|
| 89 |
.table-wrap { overflow-x: auto; border: 1px solid #e2e8f0; border-radius: 12px; margin-bottom: 30px; }
|
|
|
|
| 105 |
|
| 106 |
.footer { text-align: center; padding: 40px; color: #94a3b8; font-size: 14px; }
|
| 107 |
@keyframes fadeIn { from{opacity:0; transform:translateY(10px)} to{opacity:1; transform:translateY(0)} }
|
| 108 |
+
|
| 109 |
+
.arrow-down { color: #d97706; font-size: 10px; }
|
| 110 |
+
.arrow-up { color: #16a34a; font-size: 10px; }
|
| 111 |
</style>
|
| 112 |
</head>
|
| 113 |
<body>
|
|
|
|
| 305 |
|
| 306 |
modelStats.sort((a,b) => (a.wer - b.wer) || (a.cer - b.cer)); // Sorting by WER then CER
|
| 307 |
|
| 308 |
+
html = `<p class="score-desc">The <b>Simba ASR Score</b> is the global average of WER and CER across all languages in the benchmark.</p>
|
| 309 |
+
<table><thead><tr><th>Model</th><th>Simba ASR Score (WER/CER) <i class="fa-solid fa-arrow-down arrow-down"></i></th></tr></thead><tbody>`;
|
| 310 |
modelStats.forEach((m, i) => {
|
| 311 |
let rank = 1;
|
| 312 |
if (i > 0 && Math.abs(m.wer - modelStats[i-1].wer) > 0.001) rank = i + 1;
|
| 313 |
+
else if (i > 0) rank = modelStats[i-1].rank;
|
| 314 |
+
else m.rank = 1;
|
| 315 |
+
m.rank = rank;
|
| 316 |
+
|
| 317 |
let icon = '';
|
| 318 |
+
if(rank === 1) icon = 'π₯ '; else if(rank === 2) icon = 'π₯ '; else if(rank === 3) icon = 'π₯ ';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 319 |
|
| 320 |
html += `<tr><td style="font-weight:600; color:var(--simba-navy)">${icon}${m.name}</td><td><b>${fmt(m.wer)} / ${fmt(m.cer)}</b></td></tr>`;
|
| 321 |
});
|
|
|
|
| 331 |
|
| 332 |
d.data.sort((a,b) => a.Avg_WER - b.Avg_WER);
|
| 333 |
|
| 334 |
+
html = `<p class="score-desc">The <b>Family Score</b> is the average WER and CER calculated across all languages within the <b>${val}</b> family.</p>
|
| 335 |
+
<table><thead><tr><th>Model</th><th>Simba ASR Family Score <i class="fa-solid fa-arrow-down arrow-down"></i></th>`;
|
| 336 |
d.languages.forEach(l => html += `<th>${getIso(l.name, l.iso)}</th>`);
|
| 337 |
html += `</tr></thead><tbody>`;
|
| 338 |
|
| 339 |
d.data.forEach((r, idx) => {
|
|
|
|
| 340 |
if(idx===0) r.rank=1;
|
| 341 |
else if(Math.abs(r.Avg_WER - d.data[idx-1].Avg_WER) < 0.001) r.rank = d.data[idx-1].rank;
|
| 342 |
else r.rank = idx+1;
|
|
|
|
| 412 |
function renderLanguageView() {
|
| 413 |
const lang = document.getElementById('lang-select').value;
|
| 414 |
|
| 415 |
+
// 1. ASR
|
| 416 |
let asrRows = [];
|
| 417 |
Object.keys(DATA.asr.by_model).forEach(modName => {
|
| 418 |
const row = DATA.asr.by_model[modName].find(r => r.Language === lang);
|
| 419 |
if(row) asrRows.push({model: modName, wer: row.WER, cer: row.CER});
|
| 420 |
});
|
|
|
|
|
|
|
| 421 |
asrRows.sort((a,b) => (a.wer - b.wer) || (a.cer - b.cer));
|
| 422 |
|
| 423 |
+
let h1 = `<table><thead><tr><th>Model</th><th>WER <i class="fa-solid fa-arrow-down arrow-down"></i></th><th>CER <i class="fa-solid fa-arrow-down arrow-down"></i></th></tr></thead><tbody>`;
|
| 424 |
if(asrRows.length === 0) h1 += `<tr><td colspan="3">No ASR data for this language.</td></tr>`;
|
| 425 |
else {
|
| 426 |
asrRows.forEach((r, i) => {
|
|
|
|
| 427 |
if(i===0) r.rank=1;
|
| 428 |
+
else if(Math.abs(r.wer - asrRows[i-1].wer) < 0.001) r.rank = asrRows[i-1].rank;
|
| 429 |
else r.rank = i+1;
|
| 430 |
|
| 431 |
let icon = '';
|
|
|
|
| 436 |
h1 += `</tbody></table>`;
|
| 437 |
document.getElementById('lang-asr-table').innerHTML = h1;
|
| 438 |
|
| 439 |
+
// 2. TTS
|
| 440 |
let h2 = `<table><thead><tr><th>Model</th>
|
| 441 |
<th>WER(β)</th><th>MCD(β)</th><th>LogF0(β)</th><th>SpTok(β)</th>
|
| 442 |
<th>PESQ(β)</th><th>UTMOS(β)</th><th>SpBLEU(β)</th><th>SpBERT(β)</th>
|
|
|
|
| 460 |
h2 += `</tbody></table>`;
|
| 461 |
document.getElementById('lang-tts-table').innerHTML = h2;
|
| 462 |
|
| 463 |
+
// 3. SLID
|
| 464 |
+
let h3 = `<table><thead><tr><th>Model</th><th>F1-Score <i class="fa-solid fa-arrow-up arrow-up"></i></th></tr></thead><tbody>`;
|
|
|
|
| 465 |
const slidRow = DATA.slid.find(r => r.Language === lang) ||
|
| 466 |
DATA.slid.find(r => r.Language.startsWith(lang + " (")) ||
|
| 467 |
DATA.slid.find(r => r.Language.includes(lang));
|
| 468 |
|
| 469 |
if(slidRow) {
|
|
|
|
| 470 |
const models = Object.keys(slidRow).filter(k => k !== 'Language' && k !== 'ISO');
|
| 471 |
+
const scores = models.map(m => ({n: m, v: slidRow[m]})).sort((a,b) => b.v - a.v);
|
| 472 |
|
| 473 |
scores.forEach((sc, i) => {
|
|
|
|
| 474 |
if(i===0) sc.rank=1;
|
| 475 |
else if(Math.abs(sc.v - scores[i-1].v) < 0.001) sc.rank = scores[i-1].rank;
|
| 476 |
else sc.rank = i+1;
|