Proofbird Grammar — Dutch

gector-bert-nl · on-device Dutch grammar correction

Try it in your browser: coming soon on proofbird.app.

Version 2.0.0 · run 2026-11-30-1509 · tag v2.0.0, the files the Proofbird app downloads. Pin it with revision="v2.0.0". Earlier versions stay available under their tags. Versions: a new training recipe or a change to the model's design raises the first number, a new training run or changed guards and rules the second, card or metadata fixes the third.

A GECToR-style sequence tagger for Dutch grammatical error correction, exported to ONNX (fp32) to run on the CPU. It is the on-device grammar model of Proofbird, a writing assistant that works wherever you write, and it is published here so anyone can inspect what runs on their machine.

GECToR does not rewrite text. For each token it predicts one edit tag (keep, delete, replace with a word, append a word, change case, change a word's ending, put a trema back), and the edits are applied and the sentence re-tagged up to five times. The tagger only proposes local edits; it never paraphrases.

Quick start

Open in Colab

No API key, no GPU. One file, quickstart.py, downloads the model and runs it with ONNX Runtime.

pip install onnxruntime tokenizers huggingface_hub
import importlib.util
from huggingface_hub import hf_hub_download

spec = importlib.util.spec_from_file_location("quickstart", hf_hub_download("proofbird/gector-bert-nl", "quickstart.py"))
quickstart = importlib.util.module_from_spec(spec)
spec.loader.exec_module(quickstart)

model = quickstart.Gector("proofbird/gector-bert-nl")
corrected, suggestions = model.correct("Deze huis zijn erg mooi.")
print(corrected)
print(suggestions)
Dit huis is erg mooi.
[{"start": 0, "length": 4, "original": "Deze", "replacement": "Dit"}, {"start": 10, "length": 4, "original": "zijn", "replacement": "is"}]

Each suggestion gives the character position in your text (start, length), what is there now (original) and what to put instead (replacement), so you can underline it and offer the fix. From the command line: python quickstart.py "Deze huis zijn erg mooi." prints every step below.

What it corrects

The d/t endings of the present tense (Ik vindt → vind, Zij vind → vindt) and of the past participle (verstuurt → verstuurd), the past-tense suffix (praate → praatte, werkde → werkte), subject-verb agreement in person and number in the present and the past (Hij werken → werkt, De kinderen speelt → spelen, Mijn ouders woonde → woonden, Er is veel mensen → Er zijn), de and het (het stoel → de stoel), the demonstratives (Deze huis → Dit huis) and relative pronouns (het huis die → dat), the inflected adjective (een lief hond → een lieve hond, het beslissend debat → het beslissende debat), als and dan after a comparative (groter als → dan), subject pronouns (Hun wonen → Zij wonen), jou/jouw and u/uw, compounds written apart (tand arts → tandarts), the trema (ideeen → ideeën), a word written twice, and a capital at the start of a sentence. It knows these patterns on the words of everyday and written Dutch, not only on a short list: nearly 2 000 verbs, 6 000 nouns and 3 000 adjectives counted in the training text.

How it was trained

  • Base encoder: GroNLP/bert-base-dutch-cased (BERTje, Apache-2.0). A tagging head (665 edit labels) and an error-detection head sit on top.

  • Data: synthetic only. Three sources, 2 159 747 sentences:

    • 1 000 000 sentences from Dutch Wikipedia (wikimedia/wikipedia, 20231101.nl);
    • 1 000 000 sentences from the proceedings of the European Parliament (Europarl v7, sessions 1996 – May 2011): speech in the first and second person, questions and argument, the register encyclopedic text lacks;
    • 159 747 sentences from Tatoeba, everyday Dutch (the sentences held out for the checks below are excluded).

    The text was corrupted by hand-written Dutch error rules, mostly one error per sentence whatever its length; about 10% stays clean, so the model learns to leave correct text alone. Each rule was run over real text and read on real sentences first, and the training data was checked for contradictions, so that the same words are not an error in one sentence and correct in the next. A verb's number is changed only when its subject stands where a subject stands (never the object of a clause that ends in its verb: omdat zij de kinderen helpen), and about as often from plural to singular as the other way; de and het only before a noun whose gender the corpus shows; the trema only on everyday words; a name is never edited. Real sentences that carry a pattern the model needs (the d/t endings, the past-tense suffix, person and number in the present and the past, de/het, the adjective ending, a compound, the trema) were added again with the error placed exactly there, and real sentences with shapes it must leave alone (a noun before a verb that is not its subject, a collective subject, words Dutch writes twice, u as an object) were added as they are. 150 000 template sentences teach patterns the corpora rarely contain (every person of the present and the past, jij/je after the verb, de/het with an adjective, er is/er zijn). 15% of the training sentences lose their final full stop, so the model also works on text typed without one.

  • A trema as one edit, whatever the word. A missing trema is taught as "put this mark on this letter", not as one replacement per word, so the model can restore the trema of a word it never saw in training.

  • No learner corpora and no non-commercial data in the fine-tuning. No user text was used.

  • One epoch (125 697 steps, batch 64, learning rate 3e-5) on one NVIDIA L4. Run id 2026-11-30-1509.

How it was measured

Check Result
Gold set (877 hand-written sentences: 632 with one error each, 245 correct) 617 fixed, 245 left alone, 15 missed, 0 made worse
Wrong corrections on 4 000 everyday Tatoeba sentences (held out from training) 0. 3 sentences changed: 2 real mistakes in the test sentences fixed (Ik heb het brand gesticht → de brand, Layla bekeerd zich → bekeert), 1 where both forms are defensible
Wrong corrections on 4 000 sentences from European Parliament sessions the model never saw (from June 2011) 0. 3 sentences changed: 1 real mistake fixed (tot dit broos evenwicht → broze), 2 defensible
Wrong corrections on 10 000 sentences of the last part of Dutch Wikipedia (never in training) 11 (0.11%). 68 sentences changed: 47 real mistakes in the text fixed (De donker kleurtonen → donkere, De winnaars was → waren, geviert → gevierd, kathedraal kapittel → kathedraalkapittel), 11 wrong, 10 where both forms are defensible
One error planted in each of 600 unseen Wikipedia sentences 94.7% fixed
One error planted in each of 600 unseen European Parliament sentences 99.0% fixed
One error of each trained pattern placed in unseen sentences (719) 95.7% fixed
Stability: the gold re-run with one extra token in front of each sentence (the model alone) 6 of 418 sentences change result (5 capitalisation rows change by construction and are not counted)

The scores are with the model's own confidence setting (min_error_prob 0.8 in gector-meta.json: an edit the model is less than 80% sure of is not made) and the apply-side guards in gector-guards.json. Every changed sentence was checked by hand, by one reader who is not a native speaker. Without the setting the model fixes 628 of the 632 gold errors and makes more wrong corrections (25 on the three sets together instead of 11). The model was trained for precision: a missed error costs less than a wrong correction.

How to read the wrong-correction rates. The confidence setting was chosen on the same test sentences it is scored on, so a fresh sample is likely to read a little higher. The gold set and the planted errors do not depend on that choice.

Known wrong corrections. An adverb read as an adjective (Hij gaf internationaal lezingen → internationale); a correct repeat after a separable verb (trok hij in in een woonboot: one in deleted); a word read as another word class (werd geestelijke → geestelijk, in een reddingssloep invoer → invoert); a name at the start of a sentence read as a pronoun (Zen zeilde → Zij); the article of a street or place name. Text in another language inside Dutch text (Afrikaans, Sranan) can be changed. It does not add a missing word. The gold set was written for this model and has not yet been reviewed by a native speaker. It has not been measured on learner essays.

The guards. gector-guards.json holds back edits we measured as wrong in a known shape. They run in the Proofbird app (not in quickstart.py) and are part of every score above. Among them: a verb's -t form keeps its long vowel (gaat, slaapt, never gat, slapt); a word is deleted only when it is written twice, and dat dat, die die, jullie jullie stay (Ik wist dat dat Tom gelukkig zou maken); dit after a form of zijn is a pronoun (Is dit kunst?); Zei u is the verb; uw before a noun stays (Kam uw haar) and u after its verb stays (Bent u leraar?); a replacement that leaves a word the spell checker does not know is not made; a number is never deleted.

Files

File What it is
model.onnx The tagger (fp32, opset 17). Inputs input_ids, attention_mask; outputs logits_labels [1, T, 665] and logits_d [1, T, 2].
config.json The edit-label vocabulary (id2label).
vocab.txt, tokenizer.json, tokenizer_config.json The base encoder's WordPiece tokenizer.
gector-meta.json Export facts: encoder, tokenizer family, decoding defaults, run id, version.
gector-guards.json Apply-side guards: rules that hold back an edit the model gets wrong in a known way (for example gaan → gat). Part of the measured result.
language-rules.json Language facts the runtime needs (sentence-final punctuation handling).
grammar-messages.json The card text the Proofbird app shows for each kind of correction (it names the error: d or t, de or het, Adjective ending, ...).
verb-form-vocab.txt Empty for Dutch: verb forms are corrected with ending and replacement tags, not a verb table.
quickstart.py A complete Python runner: download, tokenize, run, decode, apply, suggestions. See Quick start.
quickstart.ipynb The same, as a notebook (the Open in Colab button).

The Proofbird app runs the same algorithm in C# with ONNX Runtime; the files are standard, so any GECToR-style decoder can use them.

How it works, step by step

The model never sees letters and never writes text. It reads numbers (token ids) and answers, for every word, which edit to make: one of 665 tags such as $KEEP, $DELETE, $APPEND_het, $REPLACE_als or $TRANSFORM_SUF__an (change a word's ending). quickstart.py does everything around it. This is the real run of the example above.

1. Prepare the text. The sentence goes in as written: Deze huis zijn erg mooi..

2. The request. The words are looked up in the model's dictionary (vocab.txt). A rare word is split into pieces; the edit is read at its first piece. [CLS] stands for a dummy first word, $START, so an edit on it can add a word at the very beginning; [SEP] marks the end.

words           $START  Deze  huis  zijn  erg  mooi  .
tokens          [CLS] Deze huis zijn erg mooi . [SEP]
input_ids       [1, 2109, 13479, 22777, 11330, 15788, 13, 2]
attention_mask  [1, 1, 1, 1, 1, 1, 1, 1]

Two inputs, both whole numbers (int64), shape [1, 8]: one sentence of 8 tokens.

3. The response. Two outputs (float32): logits_labels [1, 8, 665], a score for each of the 665 edits at every token, and logits_d [1, 8, 2], a score for "this word is correct" and "this word is wrong". A softmax turns each row into probabilities; the most probable edit at each word's first token is the one applied.

4. Pass by pass. The corrected sentence goes back in, until a pass changes nothing (at most five passes). Connected errors are fixed one after the other.

Pass 1: Deze huis zijn erg mooi.

Word Wrong Chosen edit Probability
$START 0.0% $KEEP 100.0%
Deze 100.0% $REPLACE_Dit 100.0%
huis 0.0% $KEEP 100.0%
zijn 100.0% $REPLACE_is 100.0%
erg 0.0% $KEEP 100.0%
mooi 0.0% $KEEP 100.0%
. 0.0% $KEEP 100.0%

→ Dit huis is erg mooi.

Pass 2: Dit huis is erg mooi.

Word Wrong Chosen edit Probability
$START 0.0% $KEEP 100.0%
Dit 0.0% $KEEP 100.0%
huis 0.0% $KEEP 100.0%
is 0.0% $KEEP 100.0%
erg 0.0% $KEEP 100.0%
mooi 0.0% $KEEP 100.0%
. 0.0% $KEEP 100.0%

→ Dit huis is erg mooi. — no change, so it stops.

5. The suggestions. The original and the final words are compared, and each changed stretch becomes one suggestion with its position in the original text (unchanged text keeps its own spacing), as in the Quick start output above.

6. Settings. Gector(repo, keep_confidence=None, min_error_prob=None) takes the two GECToR precision knobs. Left out, they come from the model's own gector-meta.json: this model sets min_error_prob to 0.8, and the Proofbird app reads the same value (at most five passes):

  • keep_confidence adds a bonus to $KEEP before choosing: higher means fewer, safer edits.
  • min_error_prob ignores an edit the model is less sure of, and leaves the whole sentence alone when no word is at least that likely to be wrong. At the model's own 0.8 the example is corrected as shown: the model is 100.0% sure one word is wrong. With min_error_prob=0 every edit the model prefers is applied (the example comes out the same): more real mistakes are fixed and more wrong corrections are made - the figures are under How it was measured.

Reading min_error_prob. It is a number from 0 to 1: how sure the model must be that something is wrong before it changes anything. At 0.5 it acts when it is at least 50% sure, at 0.7 when it is at least 70% sure. A higher number is stricter: fewer wrong corrections, and some real mistakes are left alone. A lower number is looser: more mistakes are fixed, and more wrong corrections are made. Each model carries the value that gave the best balance on its own tests; this one carries 0.8.

What Proofbird adds

quickstart.py is the model on its own. The Proofbird app runs the same algorithm in C# and adds:

  • Guards: per-language rules that hold back edits we measured as wrong in a known shape. gector-guards.json, in this repository, lists which guards are on for Dutch and their word lists; what each guard does is code in the app. The scores under How it was measured are with the guards.
  • Spelling, checked separately by the operating system's spell checker; the guards use it so a grammar edit is not made on a word that is misspelled.
  • A card for each change that names the error ("Subject–verb agreement") and, on request, explains it.

quickstart.py runs the model on its own, without the guards.

Licence and attribution

The model weights and the files in this repository are released under the Apache License 2.0. If you redistribute the model or a model built from it, keep the NOTICE file with it (Apache-2.0, section 4(d)).

The training data carries its own terms. Wikipedia text is © Wikipedia contributors, CC BY-SA 4.0. Tatoeba sentences are from tatoeba.org, CC BY 2.0 FR. Contains text from the proceedings of the European Parliament, © European Union, 1996–2011, reused under the European Parliament's legal notice, through the Europarl corpus (statmt.org/europarl, Philipp Koehn, Europarl: A Parallel Corpus for Statistical Machine Translation, MT Summit 2005). The base encoder is BERTje, GroNLP/bert-base-dutch-cased, by Wietse de Vries, Andreas van Cranenburgh, Arianna Bisazza, Tommaso Caselli, Gertjan van Noord and Malvina Nissim (University of Groningen), Apache License 2.0: BERTje: A Dutch BERT Model, arXiv:1912.09582, 2019. The tagging scheme follows GECToR (Omelianchuk et al., 2020, GECToR – Grammatical Error Correction: Tag, Not Rewrite).

How to cite

If you use or build on this model, please cite it:

@misc{hartnett2026gectornl,
  author       = {Hartnett, Patrick Andrew},
  title        = {Proofbird GECToR grammar model (Dutch)},
  year         = {2026},
  publisher    = {Hugging Face},
  howpublished = {\url{https://huggingface.co/proofbird/gector-bert-nl}},
  note         = {Proofbird, https://proofbird.app}
}

If you build on this model, a link back to this page is appreciated. If you use it in a product or service, please credit it where your users can see it, for example Grammar checking by Proofbird (https://proofbird.app).

Contact

Published by Patrick Andrew Hartnett as personal work. Questions and reports: open a discussion on this repository.

Downloads last month
96
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for proofbird/gector-bert-nl

Quantized
(1)
this model

Dataset used to train proofbird/gector-bert-nl

Paper for proofbird/gector-bert-nl