kotoshu/grammar-de v0.1.0
Fully local German grammar correction model for the ≤250 MB weight class (run anywhere, CPU real-time, no network).
- Architecture: GECToR-style token tagger (5,000-label closed vocab) with
iterative apply-and-retag decoding, on a
microsoft/mdeberta-v3-baseencoder. - Vocab pruning: 251k → 79,650 pieces (German corpus-active + specials + byte-fallback), pruned by weight-truth-verified remap — int8 ONNX 200.3 MB.
- Training: 250k GLM-5.3-Flash-verified German corrections (exact-restore gate, 48.5% yield) from typed corruption packs (articles, verb agreement, V2, separable verbs, case government); two-stage differential-LR schedule, bf16.
- Runtime: pure-Ruby tokenization (SpmBpe port, fixture-frozen byte-identical with HF) + ONNX Runtime; inference is milliseconds per sentence on a laptop CPU.
Evaluation (independently judged, no official benchmark claimed)
German has no public GEC benchmark we can license for automated scoring, so we report a held-out judge study instead:
| Measure (2,000 held-out clean sentences) | Result |
|---|---|
| Left unchanged | 86.1% |
| LLM-judge (500-sample): improved | 1.8% |
| LLM-judge (500-sample): harmed | 1.8% |
| Remaining edits judged neutral (spacing normalizations) | ~17% |
This is a deliberately conservative corrector: it almost never invents errors, and roughly half its content edits are genuine fixes of real typos in clean Wikipedia text. We do not claim SOTA on any official German GEC benchmark.
Files
| File | Purpose |
|---|---|
gec-tagger.int8.onnx |
int8-quantized tagger (200.3 MB) |
labels.json |
token-class label vocab |
pieces.json |
pruned+remapped sentencepiece pieces (SpmBpe) |
charsmap.json |
per-codepoint normalization map |
decoded_heldout.txt |
2k held-out decode output (reproducibility) |
License
CC-BY-NC-SA-4.0 (research line). An Apache-2.0 commercial line for English exists at kotoshu/grammar-en-cc; multilingual cc lines are tracked on our roadmap.
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support