Download index.html from danielrosehill/Microphone-WER-Explorer: direct link, hf CLI and curl.
- Browser
- Download file 12.6 kB
-
https://huggingface.co/spaces/danielrosehill/Microphone-WER-Explorer/resolve/main/index.html
- Command line
-
hf download hf://spaces/danielrosehill/Microphone-WER-Explorer/index.html
-
curl -L -o index.html https://huggingface.co/spaces/danielrosehill/Microphone-WER-Explorer/resolve/main/index.html
12.6 kB
| <html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Microphone WER Explorer</title> | |
| <style> | |
| :root{color-scheme:light;--page:#f4f4f2;--s:#fcfcfb;--t:#0b0b0b;--t2:#52514e;--grid:#dddcd6;--c:#2a78d6} | |
| @media(prefers-color-scheme:dark){:root{color-scheme:dark;--page:#111110;--s:#1a1a19;--t:#f0efec;--t2:#c3c2b7;--grid:#3a3a37;--c:#3987e5}} | |
| *{box-sizing:border-box}body{margin:0;background:var(--page);color:var(--t);font:16px/1.5 system-ui,sans-serif} | |
| main{max-width:1040px;margin:auto;padding:28px 16px 60px}h1{margin:0 0 6px;font-size:30px;line-height:1.2}h2{margin:0 0 4px;font-size:20px}p{margin:6px 0;max-width:75ch}.m{color:var(--t2);font-size:14px} | |
| section{background:var(--s);border-radius:12px;padding:20px;margin-top:20px}a{color:inherit} | |
| .f{display:flex;gap:12px;flex-wrap:wrap;margin:12px 0}label{font-size:13px;color:var(--t2);display:flex;flex-direction:column;gap:3px;min-width:0}select,input{font:inherit;font-size:15px;padding:7px 9px;border:1px solid var(--grid);border-radius:7px;background:var(--s);color:var(--t);max-width:100%} | |
| svg{display:block;width:100%;height:auto;overflow:visible}svg text{fill:var(--t);font:13px system-ui,sans-serif}svg .d{fill:var(--t2)}.g{stroke:var(--grid);stroke-width:1}.b{fill:var(--c)}.h{fill:transparent;cursor:default}.h:focus{outline:2px solid var(--c)} | |
| .sm{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,400px),1fr));gap:22px;margin-top:14px}.sm h3{font-size:15px;margin:0 0 6px} | |
| .w{overflow:auto;max-height:520px}table{border-collapse:collapse;width:100%;font-size:14px}th,td{text-align:left;padding:7px 10px;border-bottom:1px solid var(--grid);vertical-align:top}th{position:sticky;top:0;background:var(--s)}th button{all:unset;cursor:pointer;font-weight:600}th button:focus-visible{outline:2px solid var(--c)}.n{text-align:right;font-variant-numeric:tabular-nums} | |
| #tip{position:fixed;display:none;pointer-events:none;max-width:310px;background:var(--t);color:var(--s);padding:9px 11px;border-radius:7px;font-size:13px;z-index:9;white-space:pre-line} | |
| </style></head><body><main> | |
| <h1>Microphone WER Explorer</h1> | |
| <p>Word error rate (WER) by microphone, from published studies and one personal benchmark. Lower is better. <b>Compare microphones within one test, never across tests</b>: texts, engines, rooms and distances differ.</p> | |
| <p class="m" id="status">Loading data…</p> | |
| <section><h2>Compare microphones in one test</h2><div class="f"><label>Test<select id="grp"></select></label></div><div id="bars"></div><p class="m" id="info"></p></section> | |
| <section><h2>How far apart are the microphones?</h2><p class="m">Lowest to highest WER in each test, on a log scale. The line is the spread; it isn't a ranking of studies.</p><div id="rng"></div></section> | |
| <section><h2>What fan airflow and noise did</h2><p class="m">Alander 2025, four microphones, same scale. Fan and noise levels are the thesis's own labels.</p><div class="sm" id="stress"></div></section> | |
| <section><h2>Price against error</h2><p class="m">Only results with a US dollar price. Prices mix manufacturer, reseller, in-study and approximate figures; hover for which.</p><div class="f"><label>Test<select id="pg"></select></label></div><div id="sc"></div></section> | |
| <section><h2>All results</h2><div class="f"><label>Search<input id="q" placeholder="Microphone or condition"></label><label>Type<select id="cat"></select></label><label>Study<select id="st"></select></label></div><p class="m"><span id="cnt"></span> · <a href="https://huggingface.co/datasets/danielrosehill/Microphone-WER-Studies">Dataset and CSV</a></p><div class="w"><table><thead><tr id="th"></tr></thead><tbody id="tb"></tbody></table></div></section> | |
| <section><h2>Sources and limits</h2><div id="src"></div><p class="m">Measurements belong to the cited authors. Compilation CC BY 4.0. <a href="https://github.com/danielrosehill/Microphone-WER-Studies">Corrections on GitHub</a>.</p></section> | |
| </main><div id="tip" role="status"></div> | |
| <script> | |
| const $=i=>document.getElementById(i),esc=s=>String(s).replace(/[&<>"]/g,c=>({'&':'&','<':'<','>':'>','"':'"'}[c])),pc=(v,s)=>(+v).toFixed(/bradford|tran/.test(s)?1:2)+'%'; | |
| const NM={'alander-2025':'Alander 2025','bradford-2022':'Bradford 2022','tran-2026':'Tran 2026','tipaksorn-2025':'LOTUSDIS 2025','rosehill-2025':'Rosehill 2025 (personal)'}; | |
| let D=[],sort=['id',1]; | |
| function csv(t){const R=[];let r=[],c='',q=0;for(let i=0;i<t.length;i++){const x=t[i];if(q){if(x=='"'){if(t[i+1]=='"'){c+='"';i++}else q=0}else c+=x}else if(x=='"')q=1;else if(x==','){r.push(c);c=''}else if(x=='\n'){r.push(c);R.push(r);r=[];c=''}else if(x!='\r')c+=x}if(c||r.length){r.push(c);R.push(r)}const h=R.shift();return R.filter(x=>x.length==h.length).map(x=>Object.fromEntries(h.map((k,i)=>[k,x[i]])))} | |
| const gl=g=>{const i=g.indexOf(':'),s=g.slice(0,i),x=g.slice(i+1);return NM[s]+(x=='all'?'':': '+x)}; | |
| const price=r=>r.price_amount?(r.price_basis.startsWith('author')?'~':'')+r.price_currency+' '+(+r.price_amount).toFixed(2)+' ('+r.price_basis+')':'Not listed'; | |
| const tip=r=>`${r.microphone}: ${pc(r.wer_pct,r.study_id)}\n${r.mic_type}\n${r.condition}\n${r.asr_engine}; ${r.statistic}\nPrice: ${price(r)}${r.note?'\n'+r.note:''}`; | |
| function hov(root){root.querySelectorAll('[data-tip]').forEach(e=>{const show=(x,y)=>{const t=$('tip');t.textContent=e.dataset.tip;t.style.display='block';t.style.left=Math.max(8,Math.min(x+14,innerWidth-t.offsetWidth-8))+'px';t.style.top=Math.max(8,Math.min(y+14,innerHeight-t.offsetHeight-8))+'px'},hide=()=>$('tip').style.display='none';e.onmousemove=v=>show(v.clientX,v.clientY);e.onmouseleave=hide;e.onfocus=()=>{const b=e.getBoundingClientRect();show(b.left,b.bottom)};e.onblur=hide})} | |
| const hit=(x,y,w,h,t)=>`<rect class="h" tabindex="0" role="img" aria-label="${esc(t)}" x="${x}" y="${y}" width="${w}" height="${h}" data-tip="${esc(t)}"/>`; | |
| const bar=(x,y,w,h)=>{const r=Math.min(4,w);return `<path class="b" d="M${x} ${y}h${w-r}q${r} 0 ${r} ${r}v${h-2*r}q0 ${r} ${-r} ${r}h${-(w-r)}z"/>`}; | |
| function wid(el){return Math.max(300,el.clientWidth||300)} | |
| function cut(s,n){return s.length>n?s.slice(0,n-1)+'…':s} | |
| function bars(el,rows,lab,max,narrow){const W=wid(el),two=W<620&&!narrow,L=two?0:narrow?112:Math.min(340,W*.42),rh=two?46:32,mx=max||Math.max(...rows.map(r=>+r.wer_pct)),sp=W-L-62;let o=`<svg viewBox="0 0 ${W} ${rows.length*rh}">`;rows.forEach((r,i)=>{const y=i*rh,w=Math.max(2,r.wer_pct/mx*sp),by=two?y+22:y+6,n=Math.floor((two?W:L)/7.2);o+=two?`<text x="0" y="${y+15}">${esc(cut(lab(r),n))}</text>`:`<text x="0" y="${y+20}">${esc(cut(lab(r),n))}</text>`;o+=bar(L,by,w,18)+`<text x="${L+w+7}" y="${by+14}">${pc(r.wer_pct,r.study_id)}</text>`+hit(0,y,W,rh,tip(r))});el.innerHTML=o+'</svg>';hov(el)} | |
| function drawG(){const g=$('grp').value,R=D.filter(r=>r.comparison_group==g).sort((a,b)=>a.wer_pct-b.wer_pct),s=R[0],dup=new Set(R.map(r=>r.condition)).size>1&&/all$/.test(g);bars($('bars'),R,r=>r.microphone+(dup?' ('+r.condition+')':''));$('info').innerHTML=`${esc(s.asr_engine)}. ${esc(s.statistic)}. <b>Limits:</b> ${esc(s.source_limits)} <a href="${esc(s.source_url)}">Source</a>`} | |
| const groups=()=>[...new Set(D.map(r=>r.comparison_group))]; | |
| function drawR(){const el=$('rng'),W=wid(el),two=W<620,L=two?10:290,rh=two?46:30,G=groups(),lx=v=>L+Math.log(v/2)/Math.log(80)*(W-L-40),H=G.length*rh;let o=`<svg viewBox="0 0 ${W} ${H+30}">`;[2,5,10,20,50,100].forEach(v=>o+=`<line class="g" x1="${lx(v)}" x2="${lx(v)}" y1="0" y2="${H}"/><text class="d" text-anchor="middle" x="${lx(v)}" y="${H+20}">${v}%</text>`);G.forEach((g,i)=>{const V=D.filter(r=>r.comparison_group==g).sort((a,b)=>a.wer_pct-b.wer_pct),a=V[0],b=V.at(-1),y=i*rh+(two?32:rh/2),t=`${gl(g)}\nLowest: ${a.microphone}, ${pc(a.wer_pct,a.study_id)}\nHighest: ${b.microphone}, ${pc(b.wer_pct,b.study_id)}\n${V.length} results`;o+=`<text x="${two?0:0}" y="${two?i*rh+15:y+5}">${esc(gl(g))}</text><line x1="${lx(a.wer_pct)}" x2="${lx(b.wer_pct)}" y1="${y}" y2="${y}" stroke="var(--c)" stroke-width="2"/>`;[a,b].forEach(r=>o+=`<circle class="b" cx="${lx(r.wer_pct)}" cy="${y}" r="5" stroke="var(--s)" stroke-width="2"/>`);o+=hit(0,i*rh,W,rh,t)});el.innerHTML=o+'</svg>';hov(el)} | |
| function drawS(){const P=D.filter(r=>r.condition.startsWith('phase 3')),el=$('stress'),M=[...new Set(P.map(r=>r.microphone))];el.innerHTML=M.map(m=>`<div><h3>${esc(m)}</h3><div></div></div>`).join('');M.forEach((m,i)=>bars(el.children[i].lastChild,P.filter(r=>r.microphone==m),r=>({'no distraction':'Quiet','fan level 1':'Fan 1','fan level 2 (strongest)':'Fan 2 (max)','noise level 5':'Noise 5','noise level 6 (loudest)':'Noise 6 (max)'}[r.condition.slice(9)]),100,true))} | |
| function drawP(){const el=$('sc'),W=wid(el),H=330,L=48,R=D.filter(r=>r.comparison_group==$('pg').value&&r.price_currency=='USD'),mx=Math.ceil(Math.max(...R.map(r=>+r.price_amount))/100)*100,my=Math.ceil(Math.max(...R.map(r=>+r.wer_pct))*1.1),X=v=>L+v/mx*(W-L-24),Y=v=>H-40-v/my*(H-60);let o=`<svg viewBox="0 0 ${W} ${H}">`;for(let i=0;i<=4;i++){const y=my*i/4,x=mx*i/4;o+=`<line class="g" x1="${L}" x2="${W-24}" y1="${Y(y)}" y2="${Y(y)}"/><text class="d" x="${L-8}" y="${Y(y)+4}" text-anchor="end">${+y.toFixed(1)}%</text><text class="d" text-anchor="middle" x="${X(x)}" y="${H-20}">$${x}</text>`}R.forEach(r=>o+=`<circle class="b" cx="${X(r.price_amount)}" cy="${Y(r.wer_pct)}" r="6" stroke="var(--s)" stroke-width="2"/>`);R.forEach(r=>o+=hit(X(r.price_amount)-12,Y(r.wer_pct)-12,24,24,tip(r)));o+=`<text class="d" x="${W-24}" y="${H-2}" text-anchor="end">Price (US$)</text><text class="d" x="0" y="10">WER</text>`;el.innerHTML=o+'</svg>';hov(el)} | |
| const C=[['microphone','Microphone'],['mic_category','Type'],['condition','Condition'],['asr_engine','Engine'],['wer_pct','WER'],['price_amount','Price'],['study_id','Study']]; | |
| function drawT(){const q=$('q').value.toLowerCase(),R=D.filter(r=>(!q||(r.microphone+r.condition+r.mic_type).toLowerCase().includes(q))&&(!$('cat').value||r.mic_category==$('cat').value)&&(!$('st').value||r.study_id==$('st').value)).sort((a,b)=>{const k=sort[0],n=['id','wer_pct','price_amount'].includes(k),x=a[k],y=b[k];if(n&&(x===''||y===''))return (x==='')-(y==='');return (n?x-y:x.localeCompare(y))*sort[1]});$('cnt').textContent=R.length+' results. Sorting by WER across studies does not rank microphones';$('tb').innerHTML=R.map(r=>`<tr><td>${esc(r.microphone)}</td><td>${esc(r.mic_type)}</td><td>${esc(r.condition)}</td><td>${esc(r.asr_engine)}</td><td class="n">${pc(r.wer_pct,r.study_id)}</td><td>${r.price_amount?(r.price_source_url?`<a href="${esc(r.price_source_url)}">${esc(price(r))}</a>`:esc(price(r))):'Not listed'}</td><td><a href="${esc(r.source_url)}">${NM[r.study_id]}</a></td></tr>`).join('')} | |
| function opt(el,a,all){el.innerHTML=(all?`<option value="">${all}</option>`:'')+a.map(([v,t])=>`<option value="${esc(v)}">${esc(t)}</option>`).join('')} | |
| function all(){drawG();drawR();drawS();drawP()} | |
| (async()=>{let live=true,t;try{const r=await fetch('https://huggingface.co/datasets/danielrosehill/Microphone-WER-Studies/resolve/main/master.csv');if(!r.ok)throw 0;t=await r.text()}catch(e){live=false;t=await(await fetch('master.csv')).text()} | |
| D=csv(t);$('status').textContent=`${D.length} results, ${new Set(D.map(r=>r.study_id)).size} sources, ${new Set(D.map(r=>r.microphone)).size} microphone entries. ${live?'Read live from the dataset.':'Dataset unreachable; showing the bundled copy.'}`; | |
| opt($('grp'),groups().map(g=>[g,gl(g)]));opt($('pg'),groups().filter(g=>new Set(D.filter(r=>r.comparison_group==g&&r.price_currency=='USD').map(r=>r.microphone)).size>2).map(g=>[g,gl(g)]));$('pg').value='bradford-2022:script';opt($('cat'),[...new Set(D.map(r=>r.mic_category))].sort().map(c=>[c,c.replace(/_/g,' ')]),'All types');opt($('st'),Object.entries(NM),'All studies'); | |
| $('th').innerHTML=C.map(([k,l])=>`<th><button data-k="${k}">${l}</button></th>`).join('');document.querySelectorAll('th button').forEach(b=>b.onclick=()=>{sort=[b.dataset.k,sort[0]==b.dataset.k?-sort[1]:1];drawT()}); | |
| $('grp').onchange=drawG;$('pg').onchange=drawP;['q','cat','st'].forEach(i=>$(i).oninput=drawT); | |
| $('src').innerHTML=Object.keys(NM).map(k=>{const r=D.find(x=>x.study_id==k);return r?`<p class="m"><b>${esc(r.source_authors)} (${r.source_year}).</b> <a href="${esc(r.source_url)}">${esc(r.source_title)}</a>. ${esc(r.source_venue)}. ${esc(r.source_limits)}</p>`:''}).join('');all();drawT();let z,pw=innerWidth;onresize=()=>{if(innerWidth==pw)return;pw=innerWidth;clearTimeout(z);z=setTimeout(all,150)}})().catch(e=>$('status').textContent='Could not load the data: '+e.message); | |
| </script></body></html> | |