anmol-unitmole's picture
Add measured final model evaluation dashboard
0f922fb verified
Raw History Blame Contribute Delete
16.3 kB
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="Portfolio-grade T5 encoder-decoder grammar correction application with tracked edits, meaning checks, over-correction warnings, and evaluation dashboard." />
<title>Grammar Error Correction · T5 Encoder-Decoder</title>
<link rel="stylesheet" href="./style.css" />
</head>
<body>
<header class="hero">
<nav class="nav-shell">
<a class="brand" href="#top"><span class="brand-mark">GEC</span><span>Encoder–Decoder Portfolio</span></a>
<div class="nav-links"><a href="#application">Application</a><a href="#evaluation">Evaluation</a><a href="#architecture">Architecture</a></div>
</nav>
<div id="top" class="hero-grid">
<div>
<p class="eyebrow">Project 05 · T5 / FLAN-T5 · Static Browser AI</p>
<h1>Grammar corrections you can inspect, not blindly accept.</h1>
<p class="hero-copy">A portfolio-grade encoder-decoder application for sentence, paragraph, and batch correction with tracked edits, rule-based error categories, confidence proxy, meaning-preservation checks, over-correction warnings, and an honest baseline-versus-fine-tuned evaluation plan.</p>
<div class="hero-actions"><a class="button primary" href="#application">Open application</a><a class="button secondary" href="https://github.com/YOUR_USERNAME/encoder-decoder-projects" target="_blank" rel="noreferrer">GitHub repository</a></div>
</div>
<aside class="hero-card">
<div class="status-dot"></div><p class="status-label">Deployment mode</p><strong id="deployment-mode">Loading…</strong>
<dl><div><dt>Selected model</dt><dd id="model-name">—</dd></div><div><dt>Legacy notebook baseline</dt><dd id="legacy-model-name">—</dd></div><div><dt>Target platform</dt><dd>Hugging Face Static</dd></div></dl>
</aside>
</div>
</header>
<main>
<section class="notice responsible-use"><strong>Responsible use:</strong> This educational portfolio demo may make incomplete, incorrect, or meaning-changing edits. Do not paste private, confidential, sensitive, legal, medical, financial, employment, compliance, customer, employee, or personally identifiable text. Human review is required.</section>
<section id="application" class="section shell">
<div class="section-heading"><p class="eyebrow">Interactive application</p><h2>Correct text and review every change</h2><p>The app runs entirely in the browser. Until a validated ONNX model is configured, the interface uses a visibly labeled fallback demonstration.</p></div>
<div class="tabs" role="tablist">
<button class="tab-button active" data-tab="single-tab">Sentence & paragraph</button>
<button class="tab-button" data-tab="batch-tab">Batch correction</button>
<button class="tab-button" data-tab="evaluation-tab">Evaluation dashboard</button>
</div>
<div id="single-tab" class="tab-panel">
<div class="workspace-grid">
<div class="input-card panel">
<label for="sample-select">Safe sample text</label><select id="sample-select"></select>
<label for="text-input">Original text</label><textarea id="text-input" rows="10" maxlength="4000" placeholder="Example: She go to the office yesterday and submit the reports."></textarea>
<div class="button-row"><button id="run-button" class="button primary">Run correction</button><button id="clear-button" class="button secondary">Clear</button></div>
<div id="run-status" class="run-status neutral">Initializing…</div>
</div>
<div class="system-card panel">
<h3>System safeguards</h3><ul class="check-list"><li>Numbers and named entities checked</li><li>Tracked edits with before/after text</li><li>Rule-based error category disclosure</li><li>Over-correction warning threshold</li><li>No server-side API or paid service</li></ul>
<div id="fallback-disclosure" class="disclosure"><strong>Fallback disclosure:</strong> This generated package does not contain trained model weights. Current fallback output is precomputed or rule-based and is not represented as FLAN-T5 inference.</div>
</div>
</div>
<div id="results-panel" class="results" hidden>
<div class="result-header"><div><p class="eyebrow">Correction result</p><h3>Side-by-side review</h3></div><span id="mode-badge" class="mode-badge">—</span></div>
<div class="metric-grid four"><div><span>Confidence proxy</span><strong id="confidence-value">—</strong></div><div><span>Meaning score</span><strong id="meaning-value">—</strong></div><div><span>Tracked edits</span><strong id="edit-count-value">—</strong></div><div><span>Latency</span><strong id="latency-value">—</strong></div></div>
<div class="comparison-grid"><article class="panel"><h4>Original text</h4><p id="original-output"></p></article><article class="panel"><h4>Corrected text</h4><p id="corrected-output"></p></article></div>
<div class="comparison-grid"><article class="panel"><h4>Original with highlights</h4><p id="original-highlight" class="highlighted"></p></article><article class="panel"><h4>Corrected with highlights</h4><p id="corrected-highlight" class="highlighted"></p></article></div>
<div class="analysis-grid"><article class="panel"><h4>Tracked edits</h4><ul id="edit-list" class="edit-list"></ul></article><article class="panel"><h4>Error categories</h4><div id="category-list" class="tag-list"></div><p class="muted">Categories are rule-based approximations, not gold linguistic annotations.</p></article><article class="panel"><h4>Meaning-preservation checks</h4><ul id="meaning-warnings"></ul></article></div>
<div id="overcorrection-warning" class="warning-card"></div>
</div>
</div>
<div id="batch-tab" class="tab-panel" hidden>
<div class="panel"><label for="batch-input">One sentence or paragraph per line</label><textarea id="batch-input" rows="10" placeholder="She go to school yesterday.\nEvery analyst have to validate their data."></textarea><div class="button-row"><button id="batch-run-button" class="button primary">Run batch</button><button id="download-button" class="button secondary">Download CSV</button></div></div>
<div id="batch-result-panel" class="panel table-wrap" hidden><table class="metric-table"><thead><tr><th>ID</th><th>Original</th><th>Corrected</th><th>Edits</th><th>Categories</th><th>Confidence</th><th>Meaning</th><th>Over-correction</th><th>Latency</th></tr></thead><tbody id="batch-results-body"></tbody></table></div>
</div>
<div id="evaluation-tab" class="tab-panel" hidden><div id="evaluation-dashboard"></div></div>
</section>
<!-- FINAL_METRICS_DASHBOARD -->
<section style="background:#f5f7fb;padding:72px 24px;border-top:1px solid #dde4ee;border-bottom:1px solid #dde4ee;">
<div style="max-width:980px;margin:0 auto;">
<div style="margin-bottom:32px;">
<div style="font-size:12px;font-weight:800;letter-spacing:1.7px;text-transform:uppercase;color:#2563eb;margin-bottom:10px;">
Measured model performance
</div>
<h2 style="font-size:38px;line-height:1.12;margin:0 0 12px;color:#0b1729;font-weight:800;">
Final FLAN-T5 Base evaluation
</h2>
<p style="margin:0;max-width:780px;color:#526175;font-size:16px;line-height:1.65;">
Held-out evaluation results for the selected Base Conservative 30% Identity model.
Metrics are taken from the executed project evaluation pipeline.
</p>
</div>
<div style="display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:14px;margin-bottom:28px;">
<div style="background:white;border:1px solid #d9e1ec;border-radius:14px;padding:22px;">
<div style="font-size:12px;text-transform:uppercase;letter-spacing:1px;color:#66758a;font-weight:700;">ERRANT F0.5</div>
<div style="font-size:34px;font-weight:800;color:#0b1729;margin-top:8px;">0.4527</div>
<div style="font-size:13px;color:#65758a;margin-top:6px;">Primary precision-weighted GEC score</div>
</div>
<div style="background:white;border:1px solid #d9e1ec;border-radius:14px;padding:22px;">
<div style="font-size:12px;text-transform:uppercase;letter-spacing:1px;color:#66758a;font-weight:700;">Precision</div>
<div style="font-size:34px;font-weight:800;color:#0b1729;margin-top:8px;">0.5053</div>
<div style="font-size:13px;color:#65758a;margin-top:6px;">Correctness of proposed edits</div>
</div>
<div style="background:white;border:1px solid #d9e1ec;border-radius:14px;padding:22px;">
<div style="font-size:12px;text-transform:uppercase;letter-spacing:1px;color:#66758a;font-weight:700;">Recall</div>
<div style="font-size:34px;font-weight:800;color:#0b1729;margin-top:8px;">0.3195</div>
<div style="font-size:13px;color:#65758a;margin-top:6px;">Reference edits recovered</div>
</div>
<div style="background:white;border:1px solid #d9e1ec;border-radius:14px;padding:22px;">
<div style="font-size:12px;text-transform:uppercase;letter-spacing:1px;color:#66758a;font-weight:700;">GLEU</div>
<div style="font-size:34px;font-weight:800;color:#0b1729;margin-top:8px;">0.7835</div>
<div style="font-size:13px;color:#65758a;margin-top:6px;">Reference-based correction quality</div>
</div>
<div style="background:white;border:1px solid #d9e1ec;border-radius:14px;padding:22px;">
<div style="font-size:12px;text-transform:uppercase;letter-spacing:1px;color:#66758a;font-weight:700;">Semantic similarity</div>
<div style="font-size:34px;font-weight:800;color:#0b1729;margin-top:8px;">93.84%</div>
<div style="font-size:13px;color:#65758a;margin-top:6px;">Meaning-preservation proxy</div>
</div>
<div style="background:white;border:1px solid #d9e1ec;border-radius:14px;padding:22px;">
<div style="font-size:12px;text-transform:uppercase;letter-spacing:1px;color:#66758a;font-weight:700;">Clean over-correction</div>
<div style="font-size:34px;font-weight:800;color:#b45309;margin-top:8px;">25.73%</div>
<div style="font-size:13px;color:#65758a;margin-top:6px;">Lower is better</div>
</div>
</div>
<div style="display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:14px;margin-bottom:34px;">
<div style="background:#0d1b2d;color:white;border-radius:14px;padding:20px;">
<div style="font-size:12px;letter-spacing:1px;text-transform:uppercase;color:#9fb3cc;">Number preservation</div>
<div style="font-size:28px;font-weight:800;margin-top:8px;">99.72%</div>
</div>
<div style="background:#0d1b2d;color:white;border-radius:14px;padding:20px;">
<div style="font-size:12px;letter-spacing:1px;text-transform:uppercase;color:#9fb3cc;">Named-entity preservation</div>
<div style="font-size:28px;font-weight:800;margin-top:8px;">93.57%</div>
</div>
<div style="background:#0d1b2d;color:white;border-radius:14px;padding:20px;">
<div style="font-size:12px;letter-spacing:1px;text-transform:uppercase;color:#9fb3cc;">Technical-term preservation</div>
<div style="font-size:28px;font-weight:800;margin-top:8px;">99.63%</div>
</div>
<div style="background:#0d1b2d;color:white;border-radius:14px;padding:20px;">
<div style="font-size:12px;letter-spacing:1px;text-transform:uppercase;color:#9fb3cc;">Average batched latency</div>
<div style="font-size:28px;font-weight:800;margin-top:8px;">75.85 ms</div>
</div>
</div>
<div style="background:white;border:1px solid #d9e1ec;border-radius:14px;overflow:hidden;">
<div style="padding:20px 22px;border-bottom:1px solid #e4eaf2;">
<strong style="font-size:17px;color:#0b1729;">Final model selection comparison</strong>
<div style="font-size:13px;color:#66758a;margin-top:5px;">Why Base 30% Identity was selected over Base 10%</div>
</div>
<div style="overflow-x:auto;">
<table style="width:100%;border-collapse:collapse;font-size:14px;">
<thead>
<tr style="background:#f8fafc;color:#526175;text-align:left;">
<th style="padding:14px 18px;">Model</th>
<th style="padding:14px 18px;">F0.5</th>
<th style="padding:14px 18px;">Precision</th>
<th style="padding:14px 18px;">Recall</th>
<th style="padding:14px 18px;">GLEU</th>
<th style="padding:14px 18px;">Over-correction</th>
</tr>
</thead>
<tbody>
<tr style="border-top:1px solid #edf1f6;">
<td style="padding:14px 18px;font-weight:700;">Base 10% Identity</td>
<td style="padding:14px 18px;">0.4530</td>
<td style="padding:14px 18px;">0.4989</td>
<td style="padding:14px 18px;">0.3311</td>
<td style="padding:14px 18px;">0.7830</td>
<td style="padding:14px 18px;">29.38%</td>
</tr>
<tr style="border-top:1px solid #edf1f6;background:#eff6ff;">
<td style="padding:14px 18px;font-weight:800;color:#1d4ed8;">Base 30% Identity &mdash; Selected</td>
<td style="padding:14px 18px;font-weight:700;">0.4527</td>
<td style="padding:14px 18px;font-weight:700;">0.5053</td>
<td style="padding:14px 18px;">0.3195</td>
<td style="padding:14px 18px;font-weight:700;">0.7835</td>
<td style="padding:14px 18px;font-weight:700;">25.73%</td>
</tr>
</tbody>
</table>
</div>
</div>
<p style="font-size:12px;color:#738197;margin:16px 0 0;">
Evaluation values are measured project results. Over-correction and named-entity preservation remain known limitations and are disclosed in the model card.
</p>
</div>
</section>
<section id="evaluation" class="section contrast"><div class="shell"><div class="section-heading"><p class="eyebrow">Evaluation philosophy</p><h2>Precision-first grammar correction</h2></div><div class="feature-grid"><article><h3>ERRANT F0.5</h3><p>Primary correction metric after local evaluation, weighting precision more than recall.</p></article><article><h3>Meaning preservation</h3><p>Sentence embeddings, number/entity checks, protected terms, and deletion/insertion warnings.</p></article><article><h3>Over-correction</h3><p>Measures unnecessary edits to already acceptable text and aggressive style rewrites.</p></article><article><h3>Deployment evidence</h3><p>Latency, model size, quantized-vs-PyTorch comparison, and browser compatibility notes.</p></article></div></div></section>
<section id="architecture" class="section shell"><div class="section-heading"><p class="eyebrow">Architecture</p><h2>Train locally, deploy responsibly</h2></div><div class="pipeline"><div><span>1</span><h3>Prepare data</h3><p>BEA-2019/W&I+LOCNESS, JFLEG, controlled synthetic pairs, and safe custom examples.</p></div><div><span>2</span><h3>Fine-tune</h3><p>FLAN-T5-small with mixed precision, gradient accumulation, checkpoint selection, and error-type balancing.</p></div><div><span>3</span><h3>Evaluate</h3><p>ERRANT, GLEU, semantic similarity, sentence accuracy, over-correction rate, latency, and failure analysis.</p></div><div><span>4</span><h3>Export</h3><p>Optimum ONNX export, dynamic quantization, output validation, and browser model packaging.</p></div><div><span>5</span><h3>Deploy</h3><p>Static HTML, CSS, JavaScript, Transformers.js/ONNX Runtime, and transparent fallback behavior.</p></div></div></section>
</main>
<footer><div class="shell footer-grid"><div><strong>05 · Grammar Error Correction</strong><p>Encoder–Decoder Models Portfolio</p></div><p>Educational project. Human review required.</p></div></footer>
<script type="module" src="./app.js"></script>
</body>
</html>