Proofbird Grammar — French
gector-bert-fr · on-device French grammar correction
Try it in your browser: type a sentence and see the corrections. The model runs on your own computer; nothing to install, and your text never leaves the page.
Version 1.3.0 · run 2026-11-17-0743 · tag v1.3.0, the files the Proofbird app downloads. Pin it with revision="v1.3.0". Earlier versions stay available under their tags (v1.2.0, v1.1.0, v1.0.0). Versions: a change to the model's design (encoder, inputs, outputs) 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 French grammatical error correction, exported to ONNX (fp32) to run on the CPU. It is the on-device grammar model of Proofbird, a writing assistant for Windows, 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 an ending), 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
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-fr", "quickstart.py"))
quickstart = importlib.util.module_from_spec(spec)
spec.loader.exec_module(quickstart)
model = quickstart.Gector("proofbird/gector-bert-fr")
corrected, suggestions = model.correct("Ma sœur sont très content.")
print(corrected)
print(suggestions)
Ma sœur est très contente.
[{"start": 8, "length": 4, "original": "sont", "replacement": "est"}, {"start": 18, "length": 7, "original": "content", "replacement": "contente"}]
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 "Ma sœur sont très content." prints every step below.
What it corrects
Gender and number agreement (adjectives, past participles after être, nouns after numerals and determiners:
Les filles sont fatigué → fatiguées, Les livres sont pur → purs), irregular feminines (La voiture était très vieux → vieille), subject-verb agreement (Les enfants joue → jouent), the verb's person after vous and tu
(Vous a raison → avez), accents that change the word (a → à, ou → où in questions, garée la → là),
contracted prepositions (à le → au, de le → du), elision (le arbre → l'arbre), the article of a noun in a
later clause (…, et le voiture est garée → la voiture, …, et le ami de Paul → l'ami), doubled words and articles
(la la porte), common homophones, and capitalisation at the start of a sentence.
How it was trained
Base encoder:
Geotrend/bert-base-fr-cased(Apache-2.0), the French reduction of multilingual BERT. A tagging head (5 000 edit labels) and an error-detection head sit on top.Data: synthetic only. Three sources, 3 250 000 sentences in all:
- 1 500 000 sentences from French Wikipedia
(
wikimedia/wikipedia,20231101.fr); - 1 500 000 sentences from the proceedings of the European Parliament (Europarl v10, sessions 1996 – May 2011): speech in the first and second person, questions and argument;
- 250 000 sentences from Tatoeba, everyday French.
The text was corrupted by hand-written French error rules, each run over real text first and changed wherever the "error" it made also occurs as correct French (
je la vois,Madame la commissaire,les pays,nous nous,Qui sont …,la une); about 10% stays clean, so the model learns to leave correct text alone. For the patterns that are hard to learn, real sentences from the three sources were repeated with the error placed exactly on the pattern (a plural adjective aftersont, irregular feminines,làat the end of a clause, a contraction or an article after a comma,où), together with correct sentences of the same shape: 80 750 extra lines and 62 520 sentence pairs. 176 000 additional template sentences teach patterns the corpora rarely contain (first and second person, questions, plural participles, agreement in a later clause).- 1 500 000 sentences from French Wikipedia
(
No learner corpora and no non-commercial data of any kind. No user text was used.
One epoch (118 361 steps, batch 64, learning rate 3e-5) on one NVIDIA L4. Run id
2026-11-17-0743; the published weights are the last step.
How it was measured
| Check | Result |
|---|---|
| Gold set (618 hand-written sentences: 478 with one error each, 140 correct) | 478 fixed, 140 left alone, 0 missed, 0 made worse |
| Wrong corrections on 4 000 everyday Tatoeba sentences (held out from training) | 3 (0.075%); 12 sentences changed: 7 fix an error in Tatoeba's own text, 2 are spelling alternatives |
| Wrong corrections on 4 000 sentences from European Parliament sessions the model never saw (June 2011) | 1 (0.025%); 3 changed, 2 fix an error in the text |
| Wrong corrections on 20 000 more of those sentences | 1 (0.005%); 7 changed, 6 fix an error in the text |
| Stability: the gold re-run with one extra token in front of each sentence | 3 sentences change result (the 4 capitalisation rows change by construction and are not counted) |
The scores are the Proofbird app's: the model with the apply-side guards in gector-guards.json (below) and the où
rule (see What Proofbird adds; 2 of the 478 fixes come from it). The model was trained for precision: a missed error
costs less than a wrong correction. A wrong correction is a change that makes correct text wrong or changes its
meaning; a change that fixes a real error in the test text (le vie → la vie, Il est allé a Tokyo → à,
l'hotel → l'hôtel, Cela inquiéte → inquiète) is a fix, and connait → connaît (both spellings are correct
since 1990) and Wikipedia → Wikipédia are counted as alternatives, not as wrong. The wrong ones: une martre →
un, Il n'est pas dupe → dupé, le future → la future (the error there is future, not the article) and
Ou approuverez-vous … → Où.
The guards, which run in the Proofbird app, keep là at the end of a clause (l'étagère là, never la), est after a
closing quote (« Aix-la-Chapelle » est Aachen, never et) and the plural verb after a coordinated subject
(Marie est Paul restent → Marie et Paul restent, never reste); a change of ending needs a determiner or subject
pronoun in view (Soyez plus gentils stays), and the app never proposes a non-word.
Known misses: a capitalised article at the start of a sentence is not elided (Le arbre est grand), and ou → où at
the end of a statement (Tu as oublié tes clés ou.) comes from the app's où rule, not from the model. It has not been
measured on learner essays.
Files
| File | What it is |
|---|---|
model.onnx |
The tagger (fp32, opset 17). Inputs input_ids, attention_mask; outputs logits_labels [1, T, 5000] 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 là → la at the end of a clause). Part of the measured result. |
language-rules.json |
Language facts the runtime needs (sentence-final punctuation handling). |
verb-form-vocab.txt |
Empty for French: verb forms are fixed by ending changes and whole-word edits. |
grammar-messages.json |
Short explanations shown with each correction. |
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 5 000 tags such as $KEEP, $DELETE, $APPEND_de, $REPLACE_as or $TRANSFORM_SUF__e (change a word's ending). quickstart.py does everything around it. This is the real run of the example above.
1. Prepare the text. language-rules.json says the final full stop comes off before the model sees the sentence (it goes back on at the end): Ma sœur sont très content.
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 Ma sœur sont très content
tokens [CLS] Ma sœur sont très content [SEP]
input_ids [11, 2191, 10685, 583, 1800, 4552, 12]
attention_mask [1, 1, 1, 1, 1, 1, 1]
Two inputs, both whole numbers (int64), shape [1, 7]: one sentence of 7 tokens.
3. The response. Two outputs (float32): logits_labels [1, 7, 5000], a score for each of the 5 000 edits at every token, and logits_d [1, 7, 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: Ma sœur sont très content
| Word | Wrong | Chosen edit | Probability |
|---|---|---|---|
| $START | 0.0% | $KEEP | 100.0% |
| Ma | 0.0% | $KEEP | 100.0% |
| sœur | 0.0% | $KEEP | 100.0% |
| sont | 99.5% | $REPLACE_est | 99.6% |
| très | 0.1% | $KEEP | 100.0% |
| content | 19.9% | $KEEP | 73.2% |
→ Ma sœur est très content
Pass 2: Ma sœur est très content
| Word | Wrong | Chosen edit | Probability |
|---|---|---|---|
| $START | 0.0% | $KEEP | 100.0% |
| Ma | 0.0% | $KEEP | 100.0% |
| sœur | 0.0% | $KEEP | 100.0% |
| est | 0.0% | $KEEP | 100.0% |
| très | 0.0% | $KEEP | 100.0% |
| content | 100.0% | $TRANSFORM_SUF__e | 100.0% |
→ Ma sœur est très contente
Pass 3: Ma sœur est très contente
| Word | Wrong | Chosen edit | Probability |
|---|---|---|---|
| $START | 0.0% | $KEEP | 100.0% |
| Ma | 0.0% | $KEEP | 100.0% |
| sœur | 0.0% | $KEEP | 100.0% |
| est | 0.0% | $KEEP | 100.0% |
| très | 0.0% | $KEEP | 100.0% |
| contente | 0.0% | $KEEP | 100.0% |
→ Ma sœur est très contente — 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=0.0, min_error_prob=0.0) takes the two GECToR precision knobs (the Proofbird app runs with both at 0, and at most five passes):
keep_confidenceadds a bonus to$KEEPbefore choosing: higher means fewer, safer edits.min_error_probignores 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. Withmin_error_prob=0.9the example is still corrected (Ma sœur est très contente.): the model is 99.5% sure one word is wrong.
What Proofbird adds
quickstart.py is the model on its own. The Proofbird app runs the same algorithm in C# and adds:
- Guards (
gector-guards.json, in this repository): per-language rules that hold back edits we measured as wrong in a known shape. 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.
- A French rule for
ou→oùwhere only "where" fits: after a negated knowing verb, an asking verb,dis-moioraucune idéewith a clause after it (je ne sais pas ou il habite→où), and a sentence-finalou.with no comma before it.ouandoùdiffer only by meaning, so the model leaves them; the rule takes the clear cases and leavesoui ou non,un jour ou l'autreandTu viens ou ?alone. quickstart.pyand the in-browser demo include theoùrule (plain text matching, no model); they run 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 Geotrend/bert-base-fr-cased by Geotrend (Abdaoui et al., 2020, Load What You Need: Smaller Versions of
Multilingual BERT), Apache-2.0. 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{hartnett2026gectorfr,
author = {Hartnett, Patrick Andrew},
title = {Proofbird GECToR grammar model (French)},
year = {2026},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/proofbird/gector-bert-fr}},
note = {Proofbird, https://proofbird.app}
}
If you build on this model, a link back to this page is appreciated.
Contact
Published by Patrick Andrew Hartnett as personal work. Questions and reports: open a discussion on this repository.