Basque writing assistant — grammar, spelling, punctuation, capitalization, calques, and doubtful words, all in one model
Txukun is a browser-based writing assistant for Basque. It detects and corrects grammar, spelling, punctuation, capitalization, word-choice, calque, and doubtful-word errors — all from a single neural model that runs privately in your browser. No text ever leaves your device.
The model is GECToR v2-mt (multi-task), a RoBERTa-eus encoder with three output heads trained on the horkonpon-corpus (199K error–correction pairs). It tags every corrected word with its error category, so suggestions are grouped and labelled by type — not lumped into a generic "grammar" bucket.
- Single model — one 87 MB int4 ONNX model replaces the old 3-model + rule-engine pipeline (GECToR v1 + MarianMT + Hunspell/BERTeus + 2,400 lines of rules)
- 8 error types — morphology, word-level, spelling, punctuation, capitalization, zalantza (doubtful words), calque, proper nouns
- Private — all inference runs in-browser via ONNX Runtime (WASM); your text never leaves your device
- Free & open-source — CC-BY-SA 4.0
- Type or paste Basque text in the editor
- Click Aztertu (Analyze)
- The model runs up to 5 iteration passes (GECToR-style iterative refinement)
- Each correction appears as a card in the right panel, grouped by error type
- Accept or dismiss each suggestion individually — no auto-apply
| Type | Basque label | Colour | What it catches |
|---|---|---|---|
morphology |
Gramatika | red | Verb agreement, case, tense, suffix errors |
word_level |
Lexikoa | red | Wrong word choice (non-calque) |
zalantza |
Zalantzak | amber | Doubtful words (e.g. abots→ahots) |
calque |
Kalkoak | purple | Syntactic calques (e.g. balore→balio) |
spelling |
Ortografia | amber | Spelling mistakes |
punctuation |
Puntuazioa | blue | Missing/wrong commas, periods, etc. |
capitalization |
Maiuskulak | blue | Missing/wrong capital letters |
proper_noun |
Izen bereziak | blue | Proper-noun spelling/capitalization |
| Model | itzune/gector-eus-v2-onnx |
| Architecture | GECToR v2-mt (RoBERTa-eus encoder + 3 heads) |
| Size | ~87 MB (int4 ONNX) |
| Training data | horkonpon-corpus — 199K pairs |
| License | CC-BY-SA 4.0 |
| Three heads | Edit labels ($KEEP / $DELETE / $REPLACE / $APPEND / $TRANSFORM), Detection ($CORRECT / $INCORRECT), Error type (9 labels incl. none) |
The model is lazy-loaded on first use and cached in the browser (Cache API) for instant subsequent loads.
| Metric | GECToR v2-mt |
|---|---|
| F0.5 | 77.6 |
| Exact match | 51.3% |
| Precision | 87.6% |
| Recall | 53.3% |
| Clean FP | 1.8% |
| Type accuracy (errors) | 75.8% |
See the model card for full per-category results and the training repo for training code.
src/
├── gector.js — ONNX model loading, 3-head inference, iterative correction
├── analyze.js — markdown stripping, diff-based error extraction, type mapping
├── models.js — thin status wrapper (load state for the UI)
├── suggestions.js — right-panel cards, 8 type-based tabs, accept/dismiss
├── editor.js — Idaztian (CodeMirror 6) + error decorations
├── main.js — entry point, event wiring, status display
├── cache.js — Cache API wrapper for model blobs
├── core/diff.js — word-level LCS diff with char offsets
├── documents.js — local document storage (IndexedDB)
├── doc-panel.js — left-panel document list
└── ui-toast.js — toast notifications
Total: ~2,400 lines (down from ~6,000+ in the old 3-model + rule-engine architecture).
npm install
npm run dev # Vite dev server on :3000
npm run build # Production build → dist/
npm run preview # Preview the production build
npm run deploy # Build + deploy to GitHub Pages@huggingface/transformers— tokenizeronnxruntime-web— ONNX inference (WASM)idaztian— markdown editor (CodeMirror 6)
- horkonpon-corpus — training data (199K pairs)
- gector-eus-v2 — training code + PyTorch model
- gemma-4-E4B-horkonpon — server-side LLM model (F0.5=80.8)
- Euskaltzaindia — normative authority
CC-BY-SA 4.0 — see LICENSE.