const $ = id => document.getElementById(id); // A score: MODS entry, completed by the chosen TEXT measure for Text. k is its page field in scores.json. const MODS = { t: {name: 'Text', unit: 'page', def: 'How much of the reference text each model reproduces, in reading order.'}, b: {name: 'Tables', unit: 'table', k: 'b', def: 'How closely table structure and cell text match the reference, on the tables each model found.'}, l: {name: 'Layout', unit: 'page', score: 'TORE F1', long: 'layout TORE F1', k: 'l', def: 'How well the page area covered by layout regions matches the reference.', detail: 'Area overlap of layout regions, at pixel level. Precision is the share of the model output’s region area that lies inside reference regions, recall the share of the reference region area the output covers, and F1 their harmonic mean. Region types are not compared. Pages without reference regions, or without output, are left out for that model.'}, }; // Table measures, completing MODS.b: f is the build.py page field (tables_h only where build.py packed it). const TABLE = { c: {score: 'TEDS', long: 'table TEDS (structure and cell text)', f: 'tables', detail: 'Tree similarity of two tables. TEDS (tree edit distance similarity) reads each table as a tree of rows and cells and counts the edits that turn one tree into the other, relative to the larger tree. Both structure (rows, cells, merged cells) and cell text count.'}, h: {score: 'TEDS with headers', long: 'table TEDS with header cells (structure, cell text and headers)', f: 'tables_h', detail: 'Tree similarity of two tables. TEDS (tree edit distance similarity) reads each table as a tree of rows and cells and counts the edits that turn one tree into the other, relative to the larger tree. Both structure (rows, cells, merged cells) and cell text count. A header cell against a body cell counts as a changed cell.'}, }; const textMeasures = () => PUBLIC ? {edc: TEXT.edc, f1: TEXT.f1} : TEXT; const tableMeasures = () => D.pages.some(p => p.tables_h) ? TABLE : {c: TABLE.c}; const ptab = p => p[TABLE[st.bm].f]; // Text measures share the normalization described in index.html (#norm). const TEXT = { edc: {score: '1 − NED (chars)', long: 'text character edit similarity (1 − character edit distance)', k: 't_edc', detail: 'Sequence similarity at character level. Edit distance counts the character insertions, deletions and substitutions that turn the model output into the reference, divided by the longer character count. Whitespace is ignored, so spacing and word breaks cost nothing, and a word with one wrong character costs one character, not a whole word. Shown as 1 − distance, so higher is better.'}, ed: {score: '1 − NED (words)', long: 'text edit similarity (1 − edit distance)', k: 't_ed', detail: 'Sequence similarity at word level. Edit distance counts the word insertions, deletions and substitutions that turn the model output into the reference, divided by the longer word count. Shown as 1 − distance, so higher is better. Sensitive to word order.'}, f1: {score: 'F1', long: 'text F1', k: 't', detail: 'Set similarity at word level. Compares the distinct words of the model output and the reference: precision is the share of output words found in the reference, recall the share of reference words found in the output, and F1 their harmonic mean. Word order and repetition are ignored.'}, meteor: {score: 'METEOR', long: 'text METEOR', k: 't_meteor', detail: 'Word alignment score. Aligns the words of the model output with those of the reference (exact, then stems, then synonyms), combines precision and recall with more weight on recall, and applies a penalty when the aligned words are out of order.'}, bleu: {score: 'BLEU', long: 'text BLEU', k: 't_bleu', detail: 'N-gram precision at word level. The share of the model output’s sequences of one to four words that also occur in the reference, with a penalty for output shorter than the reference. Sensitive to word order.'}, }; // Text with build.py EVAL_TARGET doclang (scores.json "eval_target"): a Text chooser, All content // (text.content.all) or a Matched tab with a coverage bar in reference characters, every page weighted by // the characters it scores (build.py w). Without it (markdown) Text renders as before. const CT = () => D.eval_target === 'doclang'; const CONTENT = {all: () => `How closely each model reproduces the reference text. Missed reference text and extra output count against the score. ${pagesCount('text')}`, matched: () => `How closely each model reproduces the reference ${tyWord()}text it matched; the bar shows how much that is. ${pagesCount('matched text')}`,}; // The matching explainer (#match), per score: Text with eval target doclang, and Tables. const MATCHING = { t: `
The reference and the model output (the model’s prediction for the page) are each split into spans in reading order: one span per paragraph, heading, list item, formula or table (as its cell text).
Every reference span is compared with every output span, wherever they sit on the page; each such combination is a candidate pair. A candidate pair becomes a match only if its two texts are similar enough to be the same content. Each span belongs to at most one match, and the most similar candidates are taken first. A match also takes in a neighbouring span when that makes its two sides more alike, so a paragraph that one side splits into two spans is still matched as a whole.
Spans left without a match are unmatched: a reference span is not matched (missed text), an output span is extra.
The measure is computed on matches only, one value per match. The Matched tabs average just those, so they show how well a model reproduces what it found; the bar under each score shows how much reference text was matched or not, and how much output is extra. All content also counts not matched and extra spans, at the worst score.
`, b: `Each reference table is matched with at most one table of the model output (the model’s prediction for the page): the one that overlaps it on the page, if the overlap is large enough. A reference table without such a counterpart is not matched; an output table matched with no reference table is extra.
TEDS is computed and averaged on matched tables only, so read it with the two numbers beside it: the share of reference tables matched, and the output tables that are extra. A table that is split, merged with a neighbour or placed away from its reference counts as both not matched and extra.
`, }; // The Text chooser: All content (the page's own scores), then the Matched tabs (build.py ty): all types, and // the benchmark's text_types where some page has them. typed() = a Matched tab. const TYPE_TABS = {formula: 'Matched formulas', code: 'Matched code'}; const tabs = () => Object.fromEntries([['all', 'All content'], ['matched', 'Matched content'], ...(D.text_types || []).map(t => [t, TYPE_TABS[t] || `Matched ${t}`])] .filter(([k]) => k === 'all' || D.pages.some(p => hasType(p, k)))); // Score bar layout (trial). 'types': one Score button per kind of content (Text, each text type, Tables, // Layout), the Text chooser keeps All content | Matched content, and a score with a single measure names it // instead of offering a chooser. 'classic': Text, Tables, Layout, the text types as Matched tabs of the Text // chooser. Only the bar differs: a type button sets st.mod 't' and st.ty as its Matched tab does. // Revert by changing the default below; ?scorebar=classic|types overrides it per page load. const SCOREBAR = new URLSearchParams(globalThis.location?.search).get('scorebar') || 'types'; const TYPE_NAMES = {formula: 'Formulas', code: 'Code'}; const isType = t => t !== 'all' && t !== 'matched'; // [mod, text type or '', name] per Score button const scoreButtons = () => SCOREBAR === 'classic' || !CT() ? Object.keys(MODS).map(k => [k, '', MODS[k].name]) : [['t', '', MODS.t.name], ...Object.keys(tabs()).filter(isType).map(t => ['t', t, TYPE_NAMES[t] || t]), ['b', '', MODS.b.name], ['l', '', MODS.l.name]]; const typed = () => st.mod === 't' && CT() && st.ty !== 'all'; const tyWord = () => typed() && st.ty !== 'matched' ? st.ty + ' ' : ''; // Options (#opt-pop): st.eq counts every page equally where pages are weighted by characters (canWeigh); // a page's own score stays as scored, and pages with no characters to score stay out (their value is null). const canWeigh = () => st.mod === 't' && CT(); const weighted = () => canWeigh() && !st.eq; const pagesCount = what => st.eq ? 'Every page counts equally.' : `Each page counts by its amount of ${what}.`; const AVERAGES = () => st.eq ? 'Within a page, averages are weighted by characters, so long spans count more. Across pages, every page counts equally (Options).' : 'Averages are weighted by characters, so long spans and dense pages count more.'; const hasType = (p, t) => !!p.ty?.[t]?.c.some(c => c[1] > 0); const measure = k => k === 'b' ? {...MODS.b, ...TABLE[st.bm]} : k !== 't' ? MODS[k] : !CT() ? {...MODS.t, ...TEXT[st.tm]} : {...MODS.t, ...TEXT[st.tm], def: typed() ? CONTENT.matched() : CONTENT.all(), long: `${typed() ? `matched ${tyWord()}` : ''}${TEXT[st.tm].long}`}; const M = () => measure(st.mod); const available = (p, i) => !p.u?.includes(sys(i).key); const pairedUnits = () => U.filter(p => available(p, st.a) && available(p, st.b)); const sourceOf = p => D.aggregate ? D.sources[p.bench] : D; const heldPage = p => !!D.heldout || !!sourceOf(p).heldout; const sourceSystem = (p, i) => D.aggregate ? sourceOf(p).systems[sys(i).key] : sys(i); function pageFile(p, side) { if (heldPage(p)) return null; const source = sourceOf(p), folder = side === 'gt' ? source.ref : sourceSystem(p, side)?.dir; return folder ? `data/${p.bench || st.bench}/${folder}/${encodeURIComponent(p.doc ?? p.id)}` : null; } const VIEWS = [['page', 'Page'], ['markup', 'DocLang'], ['reading', 'Reading']]; // Text views, shown only when build.py's EVIDENCE switch packed their files (scores.json "evidence"). const TEXT_VIEWS = [['scored', 'Scored text'], ['raw', 'Raw model output']]; const views = () => D.evidence ? [...VIEWS, ...TEXT_VIEWS] : VIEWS; const NB = 20, TIE = .02; // a: a Docling model (vertical axis), b: a compared model (horizontal axis). Only Docling-vs-other pairs. // sp: Scores by category. k: the facet whose values are the axes; no: values switched off; off: hidden models; // view: the spider chart or its value table, shown one at a time. // tt: the last of All content | Matched content chosen under Text, restored when Text is chosen again const st = {bench: null, mod: 't', tm: 'edc', bm: 'c', ty: 'all', tt: 'all', eq: false, f: {}, a: 0, b: 1, d: {view: 'page', referencePage: false}, sp: {k: null, no: new Set(), off: new Set(), stat: 'mean', fit: true, view: 'chart'}}; let D = null, BENCHES = [], PUBLIC = false, focused = ''; // Set by render(): score field, units with that score, units scored for both compared models, // their scatter tiles, and per-model statistics. let K = 't', U = [], P = [], TL = new Map(), ROWS = []; const pc1 = v => (v * 100).toFixed(1), pc0 = v => v == null ? '—' : (v * 100).toFixed(0), pct = x => x > 0 && x < .01 ? '<1%' : Math.round(x * 100) + '%'; const esc = s => String(s).replace(/[&<>"']/g, c => ({'&': '&', '<': '<', '>': '>', '"': '"', "'": '''}[c])); const sys = i => D.systems[i]; // Editorial reference-quality labels only; keep benchmark identities and all score data unchanged. const REFERENCE_QUALITY = { gold: {emoji: '🥇', label: 'Gold'}, silver: {emoji: '🥈', label: 'Silver'}, bronze: {emoji: '🥉', label: 'Bronze'}, }; const referenceQuality = b => REFERENCE_QUALITY[b?.reference_quality]; // registry reference_quality, via benchmarks.json const benchmarkLabel = b => `${referenceQuality(b)?.emoji ? referenceQuality(b).emoji + ' ' : ''}${b.name}`; const qualityTitle = b => referenceQuality(b) ? `${referenceQuality(b).label} reference quality` : ''; const facetName = (k, v) => k === 'benchmark' ? benchmarkLabel(BENCHES.find(b => b.name === v) || {name: v}) : vname(v); // Page filters (build.py facets, p.a): st.f maps a facet to its selected values; OR within a facet, AND // across facets. Contains does not apply under Tables, where every unit has a table. const active = () => Object.entries(st.f).filter(([k, vs]) => vs.length && !(st.mod === 'b' && k === 'contains')); const passes = (p, skip) => active().every(([k, vs]) => k === skip || vs.some(v => p.a[k].includes(v))); const subsetPages = () => D.pages.filter(p => passes(p)); // facet counts: pages with value v that pass every other facet const valueCount = (k, v) => D.pages.filter(p => p.a[k].includes(v) && passes(p, k)).length; const shownFacets = () => D.facets.filter(f => !(st.mod === 'b' && f.k === 'contains')); const vname = v => v.replace(/_/g, ' '); const noun = () => M().unit + 's'; // A unit is what docling-inner-eval averages over: a page, or for tables one reference table (a page // copy carrying that table's scores as .b). null = excluded by the evaluator for that system (build.py); // for a table, not matched by that system. Every reference table is a unit, matched by anyone or not. // A text type: pages whose reference has that type, carrying its scores (build.py ty) under the page's // own score fields, and the page itself as .page. const units = () => st.mod === 'b' ? subsetPages().flatMap(p => ptab(p).map((b, tix) => ({...p, b, tix, tn: p.tables.length}))) : typed() ? subsetPages().filter(p => hasType(p, st.ty)).map(p => { const y = p.ty[st.ty]; // not .x/.c: p.x is a flag return {...p, ...Object.fromEntries(Object.values(TEXT).map(({k}) => [k, y[k]])), w: y.w, page: p}; }) : subsetPages().filter(u => u[K].some(v => v != null)); // Coverage of model i, R reference units (tables, or text characters) of which it matched `matched`, plus // its `extra` of `predicted` that matched nothing. pages: the pages with not matched or extra content, // most (not matched + extra) first; the bar's two segments open this one set. // Tables: reference tables it did not match, plus its tables on the page that matched no reference // table (build.py xt). Text (a Matched tab): in-scope characters over the subset's pages (the tab's c and // x), not matched plus extra characters. function coverage(i) { const rank = rows => rows.filter(r => r[1] > 0).sort((a, b) => b[1] - a[1]).map(r => r[0]); if (st.mod === 't') { const cnt = p => [...(p.ty?.[st.ty]?.c[i] || [0, 0]), ...(p.ty?.[st.ty]?.x[i] || [0, 0])]; const rows = subsetPages().map(p => [p, cnt(p)]), sum = j => rows.reduce((a, r) => a + r[1][j], 0); return {pages: rank(rows.map(([p, c]) => [p, c[1] - c[0] + c[2]])), R: sum(1), matched: sum(0), extra: sum(2), predicted: sum(3)}; } const pages = subsetPages().filter(p => available(p, i)), population = U.filter(p => available(p, i)).length, lost = p => p.tables.filter(t => t[i] == null).length, xt = p => p.xt?.[i] || 0; const extra = pages.reduce((a, p) => a + xt(p), 0), matched = population - pages.reduce((a, p) => a + lost(p), 0); return {pages: rank(pages.map(p => [p, lost(p) + xt(p)])), R: population, matched, extra, predicted: matched + extra}; } const hasCoverage = () => st.mod === 'b' || typed(); const chars = n => `${n.toLocaleString('en')} character${n === 1 ? '' : 's'}`; const share = (a, b) => b ? pct(a / b) : '—'; const tbl = n => `${n} table${n === 1 ? '' : 's'}`; // registry.aggregate: statistics.fmean and statistics.pstdev (population std) over the non-null values; // with weights (weighted()) their weighted forms and registry._weighted_percentile // Mean plot mode. 'tukey' = box plot with Tukey whiskers: the furthest score within 1.5 × IQR of // the box (trial); 'box' = box plot with whiskers min–max; both draw a Q1–Q3 box, a median line // and the mean dot. 'q' = whiskers 5th–95th percentile; 'std' = whiskers mean ± one std. // Revert by changing the default below; ?whisker=tukey|box|q|std overrides it per page load. const WHISKER = new URLSearchParams(globalThis.location?.search).get('whisker') || 'tukey'; const WH = { tukey: {box: 1, lo: x => x.tlo, hi: x => x.thi, head: 'Box plot', note: x => `median ${pc1(x.q50)} · IQR ${pc0(x.q25)}–${pc0(x.q75)}`}, box: {box: 1, lo: x => x.min, hi: x => x.max, head: 'Box plot', note: x => `median ${pc1(x.q50)} · IQR ${pc0(x.q25)}–${pc0(x.q75)}`}, q: {lo: x => x.q05, hi: x => x.q95, head: '5–95%', note: x => `std ${pc1(x.std)} · 5–95% ${pc0(x.q05)}–${pc0(x.q95)}`}, std: {lo: x => Math.max(0, x.mean - x.std), hi: x => Math.min(1, x.mean + x.std), head: 'Mean ± std', note: x => `std ${pc1(x.std)}`}, }[WHISKER]; // numpy's default (linear) percentile on sorted values, for unweighted scores const quantile = (s, p) => { const h = (s.length - 1) * p, k = Math.floor(h); return s[k] + (h - k) * (s[Math.min(k + 1, s.length - 1)] - s[k]); }; // registry._weighted_percentile: the first value whose cumulative weight reaches p of the total (pairs sorted) const wquantile = (s, T, p) => { let c = 0; for (const [v, w] of s) if ((c += w) >= p * T) return v; return s.at(-1)[0]; }; // model i's [value, weight] pairs over the units it has a score for, sorted by value const scored = (us, i) => us.filter(u => u[K][i] != null).map(u => [u[K][i], weighted() ? u.w[i] : 1]).sort((a, b) => a[0] - b[0]); // over [value, weight] pairs function stats(s) { const n = s.length, T = s.reduce((a, x) => a + x[1], 0), mean = s.reduce((a, [v, w]) => a + v * w, 0) / T, std = Math.sqrt(s.reduce((a, [v, w]) => a + w * (v - mean) ** 2, 0) / T); return {n, T, mean, std}; } // Clamped: table TEDS with cell text can fall just below 0 (docling_metrics_table); the value itself is // averaged as the evaluator does, only its bin is the lowest one. const binOf = v => Math.max(0, Math.min(NB - 1, Math.floor(v * NB))); function tip(e, html) { const t = $('tip'); t.hidden = !html; if (!html) return; t.innerHTML = html; t.style.left = Math.min(e.clientX + 14, innerWidth - t.offsetWidth - 8) + 'px'; t.style.top = e.clientY + 16 + 'px'; } // A model's identity line, and the marks beside its name: parameter count, and multi-pass inference apart from single-pass. const about = s => `${esc(s.maker)} · ${s.output_syntax === 'doctags' ? 'DocTags → DocLang' : s.docling ? 'native DocLang' : 'mapped to DocLang'}`; const tags = s => (s.params ? ` ${esc(s.params)}` : '') + (s.passes > 1 ? ` ${s.passes}-pass` : ''); /* ---------- benchmark × model coverage, independent of the selected page filters ---------- */ // Keep small summaries, not every benchmark's page/evidence data, after the disclosure loads. const realBenchmarks = () => BENCHES.filter(b => !b.aggregate); const COVERAGE = new Map(); let coverageLoading = null; function coverageSummary(data) { return {total: data.dataset_pages ?? data.pages.length, systems: data.systems.map(s => ({key: s.key, label: s.label, usable: data.pages.filter(p => !p.u?.includes(s.key) && !p.f?.includes(s.key) && !p.x?.includes(s.key)).length}))}; } function renderCoverage() { const benchmarks = realBenchmarks(); if (!benchmarks.length || benchmarks.some(b => !COVERAGE.has(b.id))) return; const models = new Map(); for (const b of benchmarks) for (const s of COVERAGE.get(b.id).systems) if (!models.has(s.key)) models.set(s.key, s); let gaps = 0, partial = 0; const gapCounts = benchmarks.map(() => 0); const rows = [...models.values()].map(model => `${total - gaps} of ${total} combinations have results · ${gaps} ${gaps === 1 ? 'gap' : 'gaps'} · ${partial} partial
Ready: usable output for at least 95% of reference pages. Yellow counts mark missing or unreadable outputs. Partial: coverage below 95%. Gap: no evaluated run is included here; raw predictions may exist elsewhere. Each experimental model version has its own row.
| Model / benchmark | ${benchmarks.map(b => `${esc(benchmarkLabel(b))} | `).join('')}
|---|---|
| Missing combinations | ${gapCounts.map(n => `${n} ${n === 1 ? 'gap' : 'gaps'} | `).join('')}
Loading coverage…
'; coverageLoading = Promise.all(benchmarks.map(async b => { if (COVERAGE.has(b.id)) return; COVERAGE.set(b.id, coverageSummary(await fetchScores(b.id))); })); try { await coverageLoading; renderCoverage(); } catch { $('coverage').innerHTML = 'Could not load coverage for every benchmark.
'; } finally { coverageLoading = null; } } $('comparison-context').addEventListener('toggle', () => { if (!PUBLIC && $('comparison-context').open) loadCoverage(); }); $('coverage').onclick = e => { if (e.target.closest('[data-coverage-retry]')) loadCoverage(); }; /* ---------- control row: the count here is the population of every chart below ---------- */ function renderBar() { const m = M(), T = D.pages.length, S = subsetPages().length, n = U.length; const bm = BENCHES.find(b => b.id === st.bench); // check.cjs loads no benchmarks.json if (bm) { const q = referenceQuality(bm); $('s0').textContent = benchmarkLabel(bm); $('reference-quality').hidden = !q; $('reference-quality').textContent = q ? `Reference quality: ${q.label}` : ''; $('about').textContent = bm.description; } const opt = b => ``, group = (label, l) => ``; // held-out benchmarks (build.py heldout) under their own header: scores only, no pages to open const own = BENCHES.filter(b => !b.aggregate), held = own.filter(b => b.heldout); $('bench').innerHTML = !held.length ? BENCHES.map(opt).join('') : BENCHES.filter(b => b.aggregate).map(opt).join('') + group('Public', own.filter(b => !b.heldout)) + group('Held out', held); $('held').hidden = !D.heldout; // in About, under the reference quality const types = SCOREBAR === 'types'; $('mod').innerHTML = scoreButtons().map(([k, t, name]) => ``).join(''); $('tm').innerHTML = Object.entries(textMeasures()).map(([k, t]) => ``).join(''); $('d-tm').innerHTML = $('tm').innerHTML; const tms = tableMeasures(), bms = st.mod === 'b' && Object.keys(tms).length > 1; // Tables: a chooser once tables_h exists if (bms) $('tm').innerHTML = Object.entries(tms).map(([k, t]) => ``).join(''); $('tm-field').hidden = !types && st.mod !== 't' && !bms; $('tm').hidden = st.mod !== 't' && !bms; $('tm').ariaLabel = bms ? 'Table measure' : 'Text measure'; $('tm-one').hidden = st.mod === 't' || bms; $('tm-one').textContent = m.score; $('words').hidden = st.tm === 'edc'; // the character measure does not split into words // types bar: "measured as … on All content | Matched content"; the type scores and Tables are matched only, // so they show Matched content pressed and All content disabled. Layout matches nothing. const only = types && (st.mod === 'b' || isType(st.ty)), what = st.mod === 'b' ? 'Tables' : TYPE_NAMES[st.ty] || st.ty; $('ty-field').hidden = !CT() || (types ? st.mod === 'l' : st.mod !== 't'); $('ty-label').textContent = types ? 'on' : 'Text'; $('ty-label').className = types ? 'tm' : 'label'; $('ty').innerHTML = Object.entries(tabs()).filter(([k]) => !types || !isType(k)).map(([k, name]) => only ? `` : ``).join(''); renderFilters(S, T); renderOptions(); const num = v => v.toLocaleString('en'), tp = new Set(U.map(u => u.id)).size; $('count').textContent = num(n); $('count-what').textContent = st.mod === 'b' ? `reference tables, on ${num(tp)} of ${num(S)} pages` : `${noun()} with ${typed() ? `${tyWord()}text in the reference` : 'a score'}${S - n ? `; the other ${num(S - n)} have ${typed() ? 'none' : 'nothing to score'}` : ''}`; $('scope').innerHTML = leftOut(); } // build.py: only pages every model has a result for are test pages; the reference's other pages (dataset_pages) // are left out, and each system's `missing` counts those it has no result for. function leftOut() { const T = D.pages.length, n = (D.dataset_pages ?? T) - T; return n > 0 ? `${n} more benchmark page${n === 1 ? ' is' : 's are'} left out: not every model has a result for ${n === 1 ? 'it' : 'them'}.` : ''; } // The Pages button, its popover (one fieldset per facet, checkboxes with counts) and a pill per active value. function renderFilters(S, T) { const nv = active().reduce((a, [, vs]) => a + vs.length, 0), pop = $('pf-pop'); $('pf-btn').textContent = nv ? `${nv} filter${nv === 1 ? '' : 's'} · ${S} pages` : `All ${T} pages`; // keep focus and scroll on the checkbox just toggled const had = document.activeElement?.closest?.('#pf-pop') && document.activeElement.dataset, top = pop.scrollTop; pop.innerHTML = shownFacets().map(({k, label, values}) => { const sel = st.f[k] || []; return ``; }).join('') + ``; pop.scrollTop = top; if (had) pop.querySelector(`input[data-k="${had.k}"][data-v="${CSS.escape(had.v)}"]`)?.focus(); const eq = st.eq && canWeigh(); $('pills').hidden = !nv && !eq; $('pills').innerHTML = (eq ? '' : '') + active().flatMap(([k, vs]) => vs.map(v => { const l = esc(D.facets.find(f => f.k === k).label); return ``; })).join(''); } const toggleValue = (k, v, on) => { const vs = (st.f[k] || []).filter(x => x !== v); st.f[k] = on ? [...vs, v] : vs; render(); }; $('pf-pop').onchange = e => { const i = e.target.closest('input[data-k]'); if (i) toggleValue(i.dataset.k, i.dataset.v, i.checked); }; $('pf-pop').onclick = e => { const b = e.target.closest('[data-clear]'); if (!b) return; if (b.dataset.clear) st.f[b.dataset.clear] = []; else st.f = {}; render(); }; $('pills').onclick = e => { if (e.target.closest('[data-eq]')) { st.eq = false; return render(); } const b = e.target.closest('button[data-k]'); if (b) toggleValue(b.dataset.k, b.dataset.v, false); }; function renderOptions() { const on = canWeigh(), pop = $('opt-pop'), had = document.activeElement?.closest?.('#opt-pop'); $('opt-btn').hidden = PUBLIC; $('opt-btn').textContent = st.eq && on ? 'Options · 1' : 'Options'; pop.innerHTML = `${on ? 'Changes the mean, the spread and the box plot under Score distribution. A page’s own score is not changed, and pages with no text to score stay out.' : 'These scores already count every page or table equally.'}
`; if (had) pop.querySelector('input:checked')?.focus(); } $('opt-pop').onchange = e => { if (e.target.name === 'eq') { st.eq = e.target.value === '1'; render(); } }; // a popover opens under its button, inside the viewport const under = (btn, pop, max) => e => { if (e.newState !== 'open') return; // client size, not inner: the visible viewport even when the page is wider than it const {clientWidth: vw, clientHeight: vh} = document.documentElement; const r = $(btn).getBoundingClientRect(), s = $(pop).style, w = Math.min(max, vw - 32); Object.assign(s, {top: `${r.bottom + 6}px`, left: `${Math.max(16, Math.min(r.left, vw - 16 - w))}px`, width: `${w}px`, maxHeight: `${vh - r.bottom - 22}px`}); }; $('pf-pop').onbeforetoggle = under('pf-btn', 'pf-pop', 600); $('opt-pop').onbeforetoggle = under('opt-btn', 'opt-pop', 360); $('about-pop').onbeforetoggle = under('about-btn', 'about-pop', 480); // the address follows the selector, so a reload stays on the chosen benchmark $('bench').onchange = e => { history.replaceState(null, '', '#' + new URLSearchParams({b: e.target.value})); load(e.target.value); }; // The bar's section links scroll rather than set #anchors: the address hash carries the benchmark and deep // links. The target lands below the bar while it is sticky (its height changes with pills and the scope line). $('jump').onclick = e => { const b = e.target.closest('[data-jump]'), bar = $('jump').closest('.bar'); if (!b) return; document.documentElement.style.scrollPaddingTop = getComputedStyle(bar).position === 'sticky' ? `${bar.offsetHeight - 24}px` : ''; $(b.dataset.jump).scrollIntoView(); }; $('mod').onclick = e => { const b = e.target.closest('button'); if (!b) return; st.mod = b.dataset.m; // types bar: a type button opens its Matched tab, Text returns from one to the last Text choice if (SCOREBAR === 'types' && st.mod === 't' && CT()) st.ty = b.dataset.t || (isType(st.ty) ? st.tt : st.ty); render(); }; $('tm').onchange = $('d-tm').onchange = e => { if (e.target.id === 'tm' && st.mod === 'b') { st.bm = e.target.value; render(); return; } st.tm = e.target.value; render(); if (!$('dlg').open) return; const p = st.d.list[st.d.pos]; if (matchedOn()) { overlayRequest++; matchedView(p); } else for (const pane of $('panes').querySelectorAll('.pane[data-side]')) { const scores = pane.querySelector('.scores'); if (scores) scores.outerHTML = pageScores(p, +pane.dataset.side); } }; $('ty').onclick = e => { const b = e.target.closest('button'); if (b && !(SCOREBAR === 'types' && (st.mod === 'b' || isType(st.ty)))) { st.ty = st.tt = b.dataset.t; render(); } }; // matched only: nothing to switch /* ---------- section 1: compact mean, and where page scores fall ---------- */ // Yellow (fewest pages) -> purple (most) in light mode, reversed in dark mode, shows density, independently of score quality. Positions run on a // log scale from the view's smallest count to its largest, and the stops are evenly spaced on it, so every // color step is the same ratio of page counts, then pulled down by STOP_SHIFT so slightly more of the range // is purple. The sparsest end fades in up to the first stop. Both constants are design choices. const LOW_END_OPACITY = .5, STOP_SHIFT = .75; const COUNT_STOP_COLORS = [ {at: 0, color: '--count-orange-high', alpha: LOW_END_OPACITY}, {at: .25 * STOP_SHIFT, color: '--distribution-orange-rich'}, {at: .5 * STOP_SHIFT, color: '--count-orange-low'}, {at: .75 * STOP_SHIFT, color: '--distribution-purple-rich'}, {at: 1, color: '--count-purple-low'}, ]; // dark is the default theme (index.html), light the media-query override const darkMode = () => !globalThis.matchMedia?.('(prefers-color-scheme:light)').matches; const countStops = () => darkMode() ? COUNT_STOP_COLORS.map((p, i, a) => ({...p, color: a[a.length - 1 - i].color})) : COUNT_STOP_COLORS; // a stop's colour, faded to its alpha when it has one const stopColor = p => p.alpha == null ? `var(${p.color})` : `color-mix(in oklab,var(${p.color}) ${p.alpha * 100}%,transparent)`; // floor: the smallest count the scale starts at (yellow); the strips use the view's smallest non-empty bin const countColor = (c, peak, profile, floor = 1) => { if (!c) return 'transparent'; const t = peak > floor ? Math.max(0, Math.min(1, Math.log(c / floor) / Math.log(peak / floor))) : 1; const stops = countStops(); if (!t) return stopColor(stops[0]); const i = stops.findIndex(p => t <= p.at), a = stops[i - 1], b = stops[i]; const mix = Math.round((t - a.at) / (b.at - a.at) * 1000) / 10; return `color-mix(in oklab,${stopColor(b)} ${mix}%,${stopColor(a)})`; }; // Legends use the exact same interpolation stops as the cells and tiles. const countGradient = profile => `linear-gradient(to right in oklab,${countStops().map(p => `${stopColor(p)} ${+(p.at * 100).toFixed(2)}%`).join(',')})`; const countRanges = (peak, profile, floor = 1) => `Continuous ${darkMode() ? 'purple → yellow' : 'yellow → purple'} gradient: ${floor}–${peak} ${noun()}${profile === 'comparison' ? ' per tile' : ''} (log scale)`; // Per model: evaluator statistics over its non-null values in the selected units, plus strip bins (pages). function rowStats() { return D.systems.map((s, i) => { const pw = scored(U, i); const v = pw.map(x => x[0]), n = v.length; if (!n) return null; const x = stats(pw), q = p => weighted() ? wquantile(pw, x.T, p) : quantile(v, p), q25 = q(.25), q75 = q(.75), f = 1.5 * (q75 - q25); const inner = v.filter(y => y >= q25 - f && y <= q75 + f), bins = Array(NB).fill(0); for (const y of v) bins[binOf(y)]++; return {s, i, ...x, min: v[0], max: v[n - 1], q05: q(.05), q25, q50: q(.5), q75, q95: q(.95), tlo: inner[0], thi: inner.at(-1), bins}; }).filter(Boolean); } function renderRows() { const m = M(), n = U.length; $('s1-sub').textContent = `${m.def} Scores in percent, higher is better.`; $('metric-title').textContent = `About ${m.long}`; // a type tab's mean leans on its densest pages const dense = tyWord() && weighted() && U.length && (r => `${pct(r.slice(0, 10).reduce((a, c) => a + c, 0) / r.reduce((a, c) => a + c, 0))} of the reference ${tyWord()}text is on the ${Math.min(10, r.length)} densest of these ${r.length} pages, so they carry about that share of the mean.`)(U.map(u => u.page.ty[st.ty].c[0][1]).sort((a, b) => b - a)); $('metric-body').innerHTML = `
${m.detail}${st.mod === 't' && !CT() ? ' An empty output scores 0.' : ''}
${dense ? `${dense}
` : ''}`; const how = st.mod !== 't' ? MATCHING[st.mod] || '' : CT() ? `${MATCHING.t}${AVERAGES()}
` : ''; $('match').hidden = !how; $('match-body').innerHTML = how; $('norm').hidden = st.mod !== 't'; for (const e of document.querySelectorAll('#norm [data-target]')) e.hidden = e.dataset.target !== (CT() ? 'doclang' : 'markdown'); ROWS = n ? rowStats() : []; if (!ROWS.length) { $('rows').innerHTML = 'No page in this selection has this score. Change the page filters or the score.
'; return; } const peak = Math.max(...ROWS.flatMap(x => x.bins)), floor = Math.min(...ROWS.flatMap(x => x.bins).filter(Boolean)); const matchedShares = new Map(); const span = hasCoverage() ? Math.max(0, ...D.systems.map((_, i) => { const c = coverage(i); matchedShares.set(i, c.R ? c.matched / c.R : 0); return c.R ? 1 + c.extra / c.R : 0; })) : 0; // coverage gets its own column and axis (share of the reference), apart from the box plot's zoomed score axis const c4 = hasCoverage() ? ' c4' : '', cv = i => hasCoverage() ? `0${peak} ${noun()}${WH.box ? `meanmedianIQR (Q1–Q3)${WHISKER === 'box' ? 'min–max' : 'within 1.5 × IQR'}` : ''}mean${hasCoverage() && ROWS.length ? `matchednot matched: no counterpart in the outputextra: no counterpart in the reference` : ''}${
passes > 1 ? `${passes}-pass needs ${passes} prediction passes to produce a complete page result` : ''}
${N >= 3 ? 'No shown model has this score on these axes.' : own && left < 3 ? `The Pages filter keeps only ${esc(own.map(v => facetName(F.k, v)).join(', '))} of ${esc(F.label)}, which leaves ${left === 1 ? 'one axis' : `${left} axes`}; a spider chart needs three. , or choose another category for the axes.` : `A spider chart needs three axes or more. Select more ${esc(F.label)} values, or change the page filters.`}
`; $('sp-tbl').innerHTML = ''; $('sp-chart').hidden = false; return; } // radial range: 0–1, or the plotted values rounded outwards to a step (the centre is then not 0) let lo = 0, hi = 1; if (sp.fit) { const mn = Math.min(...ys), mx = Math.max(...ys), s = mx - mn > .25 ? .1 : mx - mn > .08 ? .05 : .02; lo = Math.max(0, Math.floor(mn / s - .5) * s); hi = Math.max(lo + s, Math.min(1, Math.ceil(mx / s) * s)); } const ts = [.02, .05, .1, .25].find(s => (hi - lo) / s <= 5.001) || .25, ticks = []; for (let t = lo + ts; t < hi + 1e-9; t += ts) ticks.push(t); // Clamped: table TEDS can fall just below 0 (see binOf); the value itself is kept const rad = y => SPR * Math.max(0, Math.min(1, (y - lo) / (hi - lo))), ang = j => -Math.PI / 2 + 2 * Math.PI * j / N; const pt = (j, r) => [SPW / 2 + r * Math.cos(ang(j)), SPH / 2 + r * Math.sin(ang(j))], xy = p => p.map(v => v.toFixed(1)).join(','); const ring = r => SP.map((_, j) => xy(pt(j, r))).join(' '); // label spacing follows the label font, which index.html enlarges by this factor on phones const k = matchMedia('(max-width:520px)').matches ? 1.6 : 1; const labels = SP.map((c, j) => { const co = Math.cos(ang(j)), si = Math.sin(ang(j)), [x, y0] = pt(j, SPR + 14 * k), y = y0 + (si < -.3 ? -14 : si > .3 ? 10 : -2) * k; return `The centre is ${pc0(lo)}, not 0, so the areas exaggerate differences.
` : ''}`; $('sp-tbl').innerHTML = `| ${esc(F.label)} | n | ${shown.map(i => `${esc(sys(i).label)} | `).join('')}
|---|---|---|
| ${esc(facetName(F.k, c.v))} | ${c.us.length} | ${shown.map(i => `${c.m[i].y == null ? '—' : pc1(c.m[i].y)} | `).join('')}
${st.mod === 'b' && U.length ? `No reference table is matched by both ${A} and ${B}.` : `No ${noun()} to compare.`}
` + (U.length ? outside() : ''); return; } const peak = Math.max(...[...TL.values()].map(l => l.length)), floor = Math.min(...[...TL.values()].map(l => l.length)); const rects = [...TL].map(([k, l]) => { const [ix, iy] = k.split(',').map(Number); return `0${peak} ${noun()} per tile
Hover a group to find its pages in the plot${opens('; click to compare the reference with both outputs, largest gaps first')}.
` + outside(); } // Tables only: what the plot cannot show, as lists that open both models side by side. function outside() { if (st.mod !== 'b') return ''; const O = outsideLists(), A = esc(sys(st.a).label), B = esc(sys(st.b).label); const btn = (k, n, extra = '') => `${extra}`; const xt = k => { const n = O[k].reduce((a, p) => a + p.xt[st[k[1]]], 0); return btn(k, n, n ? ` on ${O[k].length} page${O[k].length === 1 ? '' : 's'}` : ''); }; // One column per model, so each long model name appears once; "neither" spans both. return `| Not in the plot | ${A} | ${B} |
|---|---|---|
| Reference tables only this model matched | ${btn('a', O.a.length)} | ${btn('b', O.b.length)} |
| Reference tables neither matched | ${btn('n', O.n.length)} | |
| Extra tables, matching no reference | ${xt('xa')} | ${xt('xb')} |
${opens('Click a count to open those tables with both outputs side by side. ')}A split or misplaced table counts both as not matched and as extra.
${cap}
Loading…`; // Report an issue: opens the benchmark-feedback issue form for this pane, prefilled with what the viewer knows. // The reference pane reports a wrong reference, a model pane a wrong DocLang mapping of that model's native output. const FEEDBACK = 'https://github.com/docling-project/benchmark-feedback/issues/new'; const reportBtn = (s, p) => heldPage(p) ? '' : ``; function reportUrl(s) { const d = st.d, p = d.list[d.pos], gt = s === 'gt', bench = p.bench || st.bench; const sample = (p.id.startsWith(bench + '/') ? p.id.slice(bench.length + 1) : p.id) + (p.tix != null ? ` (table ${p.tix + 1})` : ''); return `${FEEDBACK}?` + new URLSearchParams({template: gt ? 'reference-error.yml' : 'mapping-error.yml', title: `[${gt ? 'Reference' : 'Mapping'}] ${bench} / ${sample}${gt ? '' : ` / ${sys(s).label}`}`, benchmark: bench, sample_id: sample, ...(!gt && {model: sys(s).label}), viewer_link: linkBase() + linkHash()}); } $('dlg').addEventListener('click', e => { const b = e.target.closest('[data-report]'); if (b) open(reportUrl(b.dataset.report === 'gt' ? 'gt' : +b.dataset.report), '_blank', 'noopener'); }); function paneMarkup(s, p, v = st.d.view) { const gt = s === 'gt', name = gt ? 'Reference' : sys(s).label, key = gt ? '' : sys(s).key; const head = gt ? 'Ground truth · not scored' : pageScores(p, s); // the id is a file name: encoded, as ids hold `%` (`scihub_gbe%2Fevaa098.pdf_0`) that a server would decode const file = pageFile(p, s); if (!file) return `
${heldPage(p) ? 'Held out: scores only, no page view.' : 'No evaluated output for this benchmark.'}
No text evidence packed for this benchmark.
This output could not be read as DocLang, so it scores 0.
' : ''; const body = v === 'raw' ? (gt ? textPane(`${file}.raw.txt`, 'The reference’s DocLang, exactly as stored in the dataset.', 'No DocLang for this page') : !sourceSystem(p, s)?.raw ? 'No raw output for this system
' : textPane(`${file}.raw.txt`, 'The model’s verbatim output, exactly as emitted. Not scored.', 'No raw output for this page')) : v === 'scored' ? failed || textPane(`${file}.scored.txt`, gt // markdown target; doclang: matchedView ? 'The reference text the text metrics compare against, after normalization.' : 'The exact text the text metrics compared with the reference, after normalization.', 'No scored text for this page') : p.x?.includes(key) ? 'No output for this page
' : failed || ``; return `${e === 404 ? pre.dataset.none : 'This text did not load.'}
`; }); } } const step = k => { const d = st.d, i = d.pos + k; if (i >= 0 && i < d.list.length) { d.pos = i; renderPage(); } }; $('d-prev').onclick = () => step(-1); $('d-next').onclick = () => step(1); for (const b of document.querySelectorAll('.cp')) b.onclick = async () => { await navigator.clipboard?.writeText(b.dataset.cp === 'link' ? linkBase() + linkHash() : st.d.list[st.d.pos][b.dataset.cp] || ''); b.classList.add('ok'); setTimeout(() => b.classList.remove('ok'), 800); }; // Deep link to the page view: the hash carries what the dialog shows. Framed (the Space page, or the // profile's link), the link points at that page, which hands its hash to this app on load. deploy.sh sets SPACE. const SPACE = 'https://docling.ai/benchmarks/'; const linkBase = () => self === top || !SPACE ? location.href.split('#')[0] : SPACE; const sideKey = s => s === 'gt' ? s : sys(s).key; function linkHash() { const d = st.d, p = d.list[d.pos]; return '#' + new URLSearchParams({b: st.bench, p: p.id, ...(p.tix != null && {t: p.tix}), s: d.sides.map(sideKey).join(' '), v: d.view, ...(d.referencePage && {rp: 1}), mod: st.mod, tm: st.tm, bm: st.bm, ty: st.ty, ...(st.eq && {eq: 1})}); } // Sets the state a link carries, after load() of its benchmark; every value is checked against the loaded // data. The page list is that one page. Returns whether there is a page to open. function applyLink(q) { const p = D.pages.find(p => p.id === q.get('p') && !heldPage(p)); if (!p) return false; for (const [k, among] of [['mod', MODS], ['tm', textMeasures()], ['bm', tableMeasures()], ['ty', tabs()]]) if (Object.hasOwn(among, q.get(k))) st[k] = q.get(k); st.eq = !PUBLIC && q.get('eq') === '1'; const side = k => k === 'gt' ? k : D.systems.findIndex(s => s.key === k), t = +q.get('t'); const sides = (q.get('s') || '').split(' ').map(side).filter(s => s !== -1 && s !== 'gt'); Object.assign(st.d, {list: [q.has('t') && p.tables[t] ? {...p, b: ptab(p)[t], tix: t, tn: p.tables.length} : p], pos: 0, sides: ['gt', ...sides], view: q.get('v'), referencePage: q.get('rp') === '1'}); return true; } $('d-close').onclick = () => $('dlg').close(); $('d-view').onclick = e => { const b = e.target.closest('button'); if (b) { st.d.view = b.dataset.v; renderPage(); } }; $('d-page-image').onchange = e => { st.d.referencePage = e.target.checked; renderReferencePage(st.d.list[st.d.pos]); }; $('d-sys').onclick = e => { const b = e.target.closest('button'); if (!b) return; const s = +b.dataset.s, d = st.d; d.sides = d.sides.includes(s) ? d.sides.filter(x => x !== s) : withSide(s); renderPage(); }; document.addEventListener('keydown', e => { if (!$('dlg').open || e.target.closest('select')) return; if (e.key === 'ArrowLeft') step(-1); else if (e.key === 'ArrowRight') step(1); }); /* ---------- Scored text, DocLang target: the reference spans with each model's matched text beside them ---------- */ // build.py match_json per page: spans [{type, layer, in_scope, tokens}] (the metric's tokens, space-joined), // and per model groups [{gt, pred, ops, cost, in_scope}] (span indices; ops over the groups' joined tokens: // = same, ~ substituted, - reference only, + output only), unmatched_gt, unmatched_pred. const matchedOn = () => st.d.view === 'scored' && CT(); const MT = {cache: new Map(), changed: false, heat: true, plain: false, pin: null, byW: {}}; const mtJson = url => { if (!MT.cache.has(url)) MT.cache.set(url, fetch(url, {cache: 'no-cache'}).then(r => r.ok ? r.json() : null, () => null)); return MT.cache.get(url); }; const toks = s => s ? s.split(' ') : []; const CJK = /[ -〿-ヿ㐀-鿿豈--]/; // Scored words are shown with a gap between them, except next to a CJK character (one word each). const wgap = (x, y) => x && y && !CJK.test(x.at(-1)) && !CJK.test(y[0]) ? ' ' : ''; const wjoin = ws => ws.map((w, k) => wgap(ws[k - 1], w) + w).join(''); // Why a run of changed words differs, from its characters: whitespace (the same characters split into // other words), case, markup ($, \mathrm, braces, thin spaces) or content. const MARKUP = /\$|\\mathrm|\\,|\\!|[{}\s]/g; const CAUSES = {content: 'content differs', case: 'case only', markup: 'markup only', split: 'same characters, other word split'}; function cause(a, b) { const A = a.join(''), B = b.join(''); if (A === B) return 'split'; if (A.toLowerCase() === B.toLowerCase()) return 'case'; return A.replace(MARKUP, '').toLowerCase() === B.replace(MARKUP, '').toLowerCase() ? 'markup' : 'content'; } // [op, reference word position [span, index] | null, output word | null] -> {eq, w} | {a, b, ws, k} function mtSegments(steps, R) { const out = []; let run = null; for (const [o, p, w] of steps) { if (o === '=') { if (run) out.push(run), run = null; out.push({eq: w, w: p.join('.')}); continue; } run ??= {a: [], b: [], ws: []}; if (p) run.a.push(R[p[0]].w[p[1]]), run.ws.push(p.join('.')); if (w != null) run.b.push(w); } if (run) out.push(run); for (const s of out) if (s.a) s.k = cause(s.a, s.b); return out; } // One model against the reference: its alignment cut at reference span boundaries, so each reference row // shows the output words aligned to it (output words between two reference spans go with the first). function mtModel(R, md) { const P = md.spans.map(s => toks(s.tokens)), part = {}, wrong = new Set(), tally = {content: 0, case: 0, markup: 0, split: 0}; let last = -1; md.groups.forEach((g, gi) => { const pos = g.gt.flatMap(i => R[i].w.map((_, t) => [i, t])), b = g.pred.flatMap(j => P[j]), steps = {}; let i = 0, j = 0, cur = g.gt[0]; for (const o of g.ops) { if (o !== '+') cur = pos[i][0]; (steps[cur] ??= []).push([o, o !== '+' ? pos[i] : null, o !== '-' ? b[j] : null]); if (o !== '+') i++; if (o !== '-') j++; } const moved = g.pred[0] < last; last = Math.max(last, ...g.pred); for (const s of g.gt) { const segs = mtSegments(steps[s] || [], R); part[s] = {g, gi, moved, segs}; if (g.in_scope) for (const x of segs) if (x.k) { tally[x.k] += Math.max(x.a.length, x.b.length); if (x.k === 'content') x.ws.forEach(w => wrong.add(w)); } } }); const owner = {}; md.groups.forEach(g => g.pred.forEach(j => { owner[j] = g; })); const extras = md.unmatched_pred.map(j => { let k = j - 1; while (k >= 0 && !owner[k]) k--; return {after: k < 0 ? -1 : owner[k].gt.at(-1), span: j, w: P[j], in_scope: md.spans[j].in_scope}; }); const missed = new Set(md.unmatched_gt); for (const i of missed) if (R[i].in_scope) R[i].w.forEach((_, t) => wrong.add(`${i}.${t}`)); return {part, wrong, tally, extras, missed}; } const mtCell = (cls, rows, body) => `No scored text for this page.
'; return; } const R = ref.spans.map(s => ({...s, w: toks(s.tokens)})), n = R.length; const A = mds.map(md => md && mtModel(R, md)); const why = s => p.f?.includes(sys(s).key) ? 'This output could not be read as DocLang, so it scores 0.' : p.x?.includes(sys(s).key) ? 'No output for this page' : 'No scored text for this page'; const rows = [], hasExtra = i => A.some(a => a?.extras.some(x => x.after === i)); const differs = i => A.some(a => a && (a.missed.has(i) ? R[i].in_scope : a.part[i]?.segs.some(x => x.k))); for (let i = -1; i < n; i++) { if (i >= 0 && (!MT.changed || differs(i))) rows.push(i); if (hasExtra(i)) rows.push(`x${i}`); } const N = models.length; let h = `ref output content differs · o case only · $ \\mathrm markup only · word split same characters, other word split (whitespace) · reference words some shown models got wrong
Loading…
'; matchedView(p); } else { $('panes').innerHTML = d.sides.map(s => paneMarkup(s, p)).join(''); fillText($('panes')); } } /* ---------- data ---------- */ function render() { K = M().k; U = units(); P = U.filter(u => u[K][st.a] != null && u[K][st.b] != null); renderBar(); renderRows(); renderSpider(); renderH2H(); } globalThis.matchMedia?.('(prefers-color-scheme:light)').addEventListener('change', () => D && render()); async function load(id) { D = await fetchScores(id); if (D.aggregate) for (const [key, summary] of Object.entries(D.source_coverage)) COVERAGE.set(key, summary); else COVERAGE.set(id, coverageSummary(D)); st.bench = id; st.f = {}; st.ty = st.tt = 'all'; Object.assign(st.sp, {k: null, no: new Set(), off: new Set()}); // defaults follow config order, never the scores: first Docling model against the first other model st.a = Math.max(0, D.systems.findIndex(s => s.docling)); st.b = Math.max(0, D.systems.findIndex(s => !s.docling)); if (!tableMeasures()[st.bm]) st.bm = 'c'; render(); if (!PUBLIC && $('comparison-context').open) loadCoverage(); } fetch('data/version.json').then(r => r.json()) // the small print; the board works without it .then(v => { $('version').textContent = `Scoring v${v.scoring}` + (v.docling ? ` · ${v.docling} maps the model outputs` : ''); }, () => {}); fetch(`data/benchmarks.json`, {cache: 'no-cache'}).then(r => r.json()).then(async b => { BENCHES = b; PUBLIC = b.some(x => x.public); $('coverage-box').hidden = PUBLIC; const q = new URLSearchParams(location.hash.slice(1)); await load(b.find(x => x.id === q.get('b'))?.id || (b.find(x => x.id === 'all') || b[0]).id); // only a known benchmark: its id goes into markup if (applyLink(q)) { render(); renderPage(); $('dlg').showModal(); } }) .catch(() => { $('app').innerHTML = 'Could not load data/. Serve this folder over HTTP, e.g. python3 -m http.server, and open it (see README.md).
'; });