Project 05 · T5 / FLAN-T5 · Static Browser AI

Grammar corrections you can inspect, not blindly accept.

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.

Responsible use: 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.

Interactive application

Correct text and review every change

The app runs entirely in the browser. Until a validated ONNX model is configured, the interface uses a visibly labeled fallback demonstration.

Initializing…

System safeguards

  • Numbers and named entities checked
  • Tracked edits with before/after text
  • Rule-based error category disclosure
  • Over-correction warning threshold
  • No server-side API or paid service
Fallback disclosure: 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.
Measured model performance

Final FLAN-T5 Base evaluation

Held-out evaluation results for the selected Base Conservative 30% Identity model. Metrics are taken from the executed project evaluation pipeline.

ERRANT F0.5
0.4527
Primary precision-weighted GEC score
Precision
0.5053
Correctness of proposed edits
Recall
0.3195
Reference edits recovered
GLEU
0.7835
Reference-based correction quality
Semantic similarity
93.84%
Meaning-preservation proxy
Clean over-correction
25.73%
Lower is better
Number preservation
99.72%
Named-entity preservation
93.57%
Technical-term preservation
99.63%
Average batched latency
75.85 ms
Final model selection comparison
Why Base 30% Identity was selected over Base 10%
Model F0.5 Precision Recall GLEU Over-correction
Base 10% Identity 0.4530 0.4989 0.3311 0.7830 29.38%
Base 30% Identity — Selected 0.4527 0.5053 0.3195 0.7835 25.73%

Evaluation values are measured project results. Over-correction and named-entity preservation remain known limitations and are disclosed in the model card.

Evaluation philosophy

Precision-first grammar correction

ERRANT F0.5

Primary correction metric after local evaluation, weighting precision more than recall.

Meaning preservation

Sentence embeddings, number/entity checks, protected terms, and deletion/insertion warnings.

Over-correction

Measures unnecessary edits to already acceptable text and aggressive style rewrites.

Deployment evidence

Latency, model size, quantized-vs-PyTorch comparison, and browser compatibility notes.

Architecture

Train locally, deploy responsibly

1

Prepare data

BEA-2019/W&I+LOCNESS, JFLEG, controlled synthetic pairs, and safe custom examples.

2

Fine-tune

FLAN-T5-small with mixed precision, gradient accumulation, checkpoint selection, and error-type balancing.

3

Evaluate

ERRANT, GLEU, semantic similarity, sentence accuracy, over-correction rate, latency, and failure analysis.

4

Export

Optimum ONNX export, dynamic quantization, output validation, and browser model packaging.

5

Deploy

Static HTML, CSS, JavaScript, Transformers.js/ONNX Runtime, and transparent fallback behavior.