Instructions to use itzune/gector-eus-v5 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use itzune/gector-eus-v5 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="itzune/gector-eus-v5")# pip install -U transformers accelerate # Load model directly from transformers import GECToR model = GECToR.from_pretrained("itzune/gector-eus-v5", device_map="auto") - Notebooks
- Google Colab
- Kaggle
GECToR v5 β Multi-task Basque Grammatical Error Correction (distilled)
GECToR (Tag, Not Rewrite) for Basque: a 125M-parameter RoBERTa encoder with
three heads β edit-label, error detection, and error type β fine-tuned on
itzune/horkonpon-corpus
plus 170k Wikipedia sentences labelled by the 8B LoRA teacher
itzune/latxa-8b-gec-lora-v2.
v5 is the third public release of the family (gector-eus β gector-eus-v2 β
gector-eus-v5; v3, v4 and v4.1 were internal iterations). It keeps v2's
architecture, tokenizer and 89 MB int4 footprint, and roughly doubles correction
quality on real Wikipedia text without raising the false-correction rate.
- Corrections + error types: each edited token is labelled
spelling,morphology,punctuation,capitalization,zalantza,proper_noun,word_levelorcalque, so UIs can explain why a word was changed. - Small and CPU-friendly: 89 MB int4 ONNX, ~50 ms per sentence on one CPU
core β see
itzune/gector-eus-v5-onnx. - Ships in txukun (Basque writing assistant).
Model details
| Architecture | GECToR (RoBERTa-eus-base encoder + edit/detect/type heads) |
| Base model | ixa-ehu/roberta-eus-euscrawl-base-cased |
| Parameters | ~125M |
| Max sequence length | 128 subwords |
| Edit vocabulary | 3,501 labels (rest β <OOV>, left to the hunspell cascade) |
| Error-type labels | 10 |
| Precision | fp32 safetensors (model.safetensors) |
| Training log | training_log.json (per-epoch train/valid loss + accuracies) |
Training data
| source | records |
|---|---|
horkonpon-corpus v4.1 train (as in v4.1) |
143,121 |
teacher edits kept (margin β1, name/size guards) |
36,878 |
| teacher-labelled clean sentences (no edit) | 133,823 |
| total | 313,822 |
The extra data is Basque Wikipedia text labelled by
itzune/latxa-8b-gec-lora-v2 with a copy-vs-edit margin of β1: a teacher edit is
kept only if the teacher scores the edited sentence no more than 1 nat below the
unchanged copy, which suppresses its over-corrections. Two guards drop edits that
touch capitalised names (Felipe β Filipe) or change sentence length. The full
290,935-row teacher output is published as
itzune/wiki-gec-distill-eu.
Training recipe
| Batch size | 32 |
| Max length | 128 |
| Epochs | 15 max, early stop (patience 3) β stopped after epoch 8 |
| Cold epochs / LR | 2 / 1e-3, then 1e-5 linear decay, 500 warmup steps |
| Type-loss weight | 0.5 |
| Seed | 42 |
| Hardware | 1Γ NVIDIA L40 |
Results
int4 ONNX, CPU, min_error_prob = 0.5 unless stated. "exact" is sentence-level
exact match on errorful sentences; F0.5 is token-level, Ξ² = 0.5 to weight
precision.
Synthetic slices (horkonpon-corpus + injected errors)
| slice | v4.1 exact | v5 exact | v4.1 F0.5 | v5 F0.5 |
|---|---|---|---|---|
| standard (1,037) | 53.1% | 55.4% | 77.7 | 79.0 |
| trivial multi-error (1,037) | 55.5% | 56.1% | 89.8 | 90.0 |
| held-out paradigm pairs (300) | 34.7% | 36.3% | 53.4 | 57.5 |
| real multi-error (826) | 42.6% | 43.2% | 82.2 | 81.7 |
Real Wikipedia slice (171 errorful + 247 clean sentences, hand-checked)
| model | exact | P | R | F0.5 | clean FP |
|---|---|---|---|---|---|
| v4.1 + spelling cascade | 8.2% | 55.6 | 7.9 | 25.2 | 0.0% |
| v5 | 13.5% | 72.7 | 16.8 | 43.7 | 0.8% |
| v5 + spelling cascade | 14.6% | 71.7 | 17.4 | 44.1 | 1.2% |
| LoRA teacher (8B), margin β1 | 28.1% | 75.3 | 30.5 | 58.2 | 2.8% |
Operating point
min_error_prob |
exact (real set) | F0.5 (real set) | F0.5 (standard) | clean FP (standard) |
|---|---|---|---|---|
| 0.45 | 14.6% | 45.5 | 78.7 | 2.3% |
| 0.50 (default) | 13.5% | 43.7 | 79.0 | 2.2% |
| 0.60 (conservative) | 12.9% | 41.4 | 79.4 | 1.6% |
Unlike v4.1, precision is flat from 0.45 to 0.65, so the threshold is no longer a lever β pick 0.5 for recall, 0.6 if false corrections on clean text are the main cost.
Usage
This checkpoint is a GECToR tag model: inference needs the decode loop (edit
extraction, iteration over up to 5 passes, verb-form dictionary), not just
AutoModelForTokenClassification. Use the exported bundle instead:
# pip install onnxruntime transformers
import json, onnxruntime as ort
from transformers import AutoTokenizer
bundle = "itzune/gector-eus-v5-onnx" # downloaded locally
tok = AutoTokenizer.from_pretrained(f"{bundle}/tokenizer", add_prefix_space=True)
vocab = json.load(open(f"{bundle}/gector_vocab.json"))
sess = ort.InferenceSession(f"{bundle}/onnx/model_q4.onnx", providers=["CPUExecutionProvider"])
# ids β labels β edits: see https://github.com/itzune/gector-eus-v2
Reference implementations (decode loop, spelling cascade, evaluation):
scripts/gector_onnx.pyβ ONNX inferencescripts/eval_onnx.pyβ F0.5 / exact / clean-FP evaluationscripts/spell_cascade.pyβ hunspell cascade for open-vocabulary spelling
Limitations
- Open-vocabulary spelling is bounded by the 3,501-label edit vocabulary; unseen words are detected but left to the hunspell cascade, so recall on rare misspellings trails an LLM by a wide margin (16.8% vs 30.5% recall on the real slice).
- Domain: trained on professionally edited Basque prose (news, encyclopedic, gazettes) plus Wikipedia edits. Performance on social-media text is untested.
- Small real-world benchmark: the 171-sentence Wikipedia slice is hand-checked but small; single-sentence differences move exact match by 0.6 points.
- Distillation domain match: the teacher labelled Wikipedia text, the same genre as the public real-world slice; part of the v5 gain reflects that match.
- Not a fluency rewriter: it performs minimal edits and will not restructure
sentences (
rewrite/word_swapfamilies are out of scope).
Licensing
The training data is CC-BY-SA-4.0 (horkonpon-corpus) and derived from the
Basque Wikipedia dump of 2026-11-01 (CC-BY-SA-4.0). The encoder it is
fine-tuned from, ixa-ehu/roberta-eus-euscrawl-base-cased, is published under
CC-BY-NC-4.0, so these weights are distributed under CC-BY-NC-SA-4.0:
non-commercial use only, share-alike, attribution required. This is stricter than
the card of itzune/gector-eus-v2, which described the weights as CC-BY-SA-4.0;
that description did not account for the base encoder's licence. Commercial use
requires permission from HiTZ / ixa-ehu for the encoder.
Citation
@misc{ezpeleta2026gectoreusv5,
author = {Xabi Ezpeleta},
title = {GECToR v5: Multi-task Basque Grammatical Error Correction,
distilled from an 8B LoRA teacher},
year = {2026},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/itzune/gector-eus-v5}},
note = {Weights: CC-BY-NC-SA-4.0. Teacher:
\url{https://huggingface.co/itzune/latxa-8b-gec-lora-v2}}
}
If you use the training data as well, please also cite
itzune/horkonpon-corpus
and itzune/wiki-gec-distill-eu.
References
Model / method
- Omelianchuk, K., Atamanchuk, V., Atrasevych, D., Chernodub, A., Skurzhanskyi, O. (2020). GECToR β Grammatical Error Correction: Tag, Not Rewrite. BEA@ACL 2020. arXiv:2005.12592
- GECToR multi-task fork: gotutiyan/gector
- Training/eval code, data recipes: itzune/gector-eus-v2
Base models and teachers
ixa-ehu/roberta-eus-euscrawl-base-casedβ Basque RoBERTa (CC-BY-NC-4.0), HiTZ- Latxa /
HiTZ/Latxa-Llama-3.1-8B-Instruct(Llama 3.1 Community Licence) - Teacher adapter:
itzune/latxa-8b-gec-lora-v2
Data and normative references
itzune/horkonpon-corpusβ Basque GEC corpus (CC-BY-SA-4.0)itzune/wiki-gec-distill-euβ teacher-labelled Wikipedia sentencesitzune/eusgec-wiki-evalβ the real-world slice used above- Euskaltzaindia β Euskara Batuaren Eskuliburua (EBE)
- Berria β Estilo Liburua
- Basque Wikipedia dump
euwiki-20261101, dumps.wikimedia.org (CC-BY-SA-4.0)
Tooling
- txukun β the writing assistant that ships this model
- Hugging Face Transformers, ONNX Runtime, Transformers.js
- hunspell +
eu_ESdictionary (spelling cascade)
- Downloads last month
- 24