Audio-Data-Dictionary / index.html
danielrosehill's picture
Data dictionary
67f8ec2 verified
Raw History Blame Contribute Delete
4.46 kB
<!doctype html>
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1">
<title>Audio Data Dictionary</title>
<style>
:root{--bg:#f6f5f1;--card:#fff;--ink:#21201c;--ink2:#56554f;--line:#e6e4dc;--accent:#2a78d6;color-scheme:light}
@media (prefers-color-scheme:dark){:root{--bg:#141413;--card:#1f1f1d;--ink:#f0efec;--ink2:#c3c2b7;--line:#33322f;--accent:#5598e7;color-scheme:dark}}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font:16px/1.5 system-ui,sans-serif}
main{max-width:960px;margin:0 auto;padding:28px 18px 60px}h1{margin:0 0 6px;font-size:clamp(26px,5vw,38px)}p{color:var(--ink2);margin:0 0 14px}a{color:var(--accent)}
.controls{display:flex;gap:8px;flex-wrap:wrap;position:sticky;top:0;background:var(--bg);padding:10px 0}
input,select{font:inherit;padding:9px 12px;border:1px solid var(--line);border-radius:10px;background:var(--card);color:var(--ink)}input{flex:1 1 220px}
h2{font-size:18px;margin:26px 0 8px;text-transform:capitalize}
.c{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:12px 14px;margin:8px 0}.c code{font-weight:700;font-size:15px}
.c p{margin:4px 0 6px;color:var(--ink)}.m{font-size:13px;color:var(--ink2)}.b{display:inline-block;border:1px solid var(--line);border-radius:999px;padding:1px 9px;margin:0 6px 4px 0}
table{width:100%;border-collapse:collapse;font-size:14px}td,th{text-align:left;padding:6px;border-bottom:1px solid var(--line)}.w{overflow-x:auto}summary{cursor:pointer;color:var(--accent)}
</style></head><body><main>
<h1>Audio Data Dictionary</h1>
<p>What every column means in Daniel Rosehill's speech datasets. Data: <a href="https://huggingface.co/datasets/danielrosehill/Audio-Data-Dictionary">danielrosehill/Audio-Data-Dictionary</a>.</p>
<div class="controls"><input id="q" type="search" placeholder="Search columns and definitions" aria-label="Search">
<select id="s" aria-label="Filter"><option value="">All columns</option><option value="takes">Takes standard</option><option value="sentences">Sentences standard</option><option value="other">Not in the standard</option><option value="inferred">Inferred, unconfirmed</option></select></div>
<p id="n" aria-live="polite">Loading...</p><div id="list"></div>
<h2>Where datasets differ now</h2><details><summary id="dn">Drift</summary><div class="w"><table><thead><tr><th>Dataset</th><th>Tab</th><th>Column</th><th>Problem</th></tr></thead><tbody id="d"></tbody></table></div></details>
</main><script>
const U="https://huggingface.co/datasets/danielrosehill/Audio-Data-Dictionary/resolve/main/",$=i=>document.getElementById(i);
const el=(t,c,x)=>{const e=document.createElement(t);if(c)e.className=c;if(x!=null)e.textContent=x;return e};
let A=[];
function rich(p,t){t.split(/(`[^`]+`|\*\*[^*]+\*\*)/).forEach(s=>{if(s[0]==="`")p.append(el("code","",s.slice(1,-1)));else if(s.startsWith("**"))p.append(el("b","",s.slice(2,-2)));else p.append(s)})}
function draw(){const q=$("q").value.toLowerCase(),f=$("s").value,L=$("list");L.replaceChildren();
const r=A.filter(e=>(e.column+" "+e.definition).toLowerCase().includes(q)&&(!f||(f==="other"?!e.standard:f==="inferred"?e.basis==="inferred":e[f+"_status"])));
$("n").textContent=r.length+" of "+A.length+" columns";
for(const g of [...new Set(r.map(e=>e.group))]){L.append(el("h2","",g));for(const e of r.filter(x=>x.group===g)){const c=el("div","c");c.id=e.column;c.append(el("code","",e.column));const p=el("p");rich(p,e.definition);c.append(p);const m=el("div","m");
for(const t of["takes","sentences"])if(e[t+"_status"])m.append(el("span","b",t+": "+e[t+"_type"]+", "+e[t+"_status"]+(e[t+"_values"]?" ("+e[t+"_values"].join(", ")+")":"")));
if(!e.standard)m.append(el("span","b","not in the standard"));if(e.basis==="inferred")m.append(el("span","b","inferred"));
m.append(el("span","b",e.live_datasets+" public datasets"+(e.live_types.length?" · "+e.live_types.join(", "):"")));c.append(m);L.append(c)}}}
Promise.all(["dictionary.json","drift.json"].map(f=>fetch(U+f).then(r=>{if(!r.ok)throw Error(r.status);return r.json()}))).then(([a,d])=>{A=a;draw();$("dn").textContent=d.length+" differences";
for(const x of d){const t=el("tr");for(const k of["dataset","tab","column","problem"])t.append(el("td","",x[k]));$("d").append(t)}}).catch(e=>{$("n").textContent="Could not load the dictionary: "+e.message});
$("q").oninput=draw;$("s").onchange=draw;
</script></body></html>