DeepQuill grammar checker (GECToR)
A GECToR token tagger (Omelianchuk et al., 2020) for grammar checking in
fiction, exported to ONNX for the DeepQuill writing app. One forward pass
labels each word $KEEP, $REPLACE_x, $APPEND_x, $DELETE,
$TRANSFORM_VERB_* or $TRANSFORM_AGREEMENT_*.
Trained by DeepQuill with tools/gec-train in the DeepQuill repository, using
only data and code that allow commercial use. No BEA-2019 data (Lang-8, NUCLE,
FCE, W&I+LOCNESS) and no published GECToR checkpoint were used.
Files
| File | |
|---|---|
model.onnx |
weights stored fp16, cast to fp32 at load; inputs input_ids, attention_mask [1,T]; outputs label_probs [1,T,L] (softmax) and error_probs [1,T] |
tokenizer.json |
RoBERTa byte-level BPE; encode ["$START", *words] as pre-tokenized input |
labels.json |
{labels, keep_label, max_length}; the label head is labels minus the trailing <PAD> |
verb-form-vocab.txt |
verb-form table for $TRANSFORM_VERB_* tags |
Read each word's tag from its first sub-token. DeepQuill flags a sentence only
when a word's error probability reaches 0.6, and applies a tag only when its
probability reaches 0.6. It drops $TRANSFORM_CASE_* tags.
Evaluation
On a 109k-word novel at threshold 0.6, the model catches 6 of 8 known errors, leaves all 12 known traps (dialect, fragments, names) alone, and raises 14.4 flags per 1,000 sentences.
Training data and attribution
| What | Source | Licence |
|---|---|---|
| Base encoder | roberta-base (Facebook AI) |
MIT |
| General errors | C4_200M (Stahlberg & Kumar, 2021, Google), via liweili/c4_200m |
edits CC BY 4.0; text ODC-BY |
| Underlying text | C4 (Raffel et al., 2020) | ODC-BY |
| Fiction | Project Gutenberg, via sedthh/gutenberg_english |
US public domain |
| Training code | gotutiyan/gector @ a4a342e |
MIT |
| Verb forms | grammarly/gector data/verb-form-vocab.txt @ 3d41d28 |
Apache-2.0 |
- Felix Stahlberg and Shankar Kumar. 2021. Synthetic Data Generation for Grammatical Error Correction with Tagged Corruption Models. BEA workshop. Dataset: https://github.com/google-research-datasets/C4_200M-synthetic-dataset-for-grammatical-error-correction (CC BY 4.0).
- Colin Raffel et al. 2020. Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer. JMLR. C4 is released under ODC-BY.
- Kostiantyn Omelianchuk et al. 2020. GECToR – Grammatical Error Correction: Tag, Not Rewrite. BEA workshop.
Model tree for deepquillapp/gector-grammar
Base model
FacebookAI/roberta-base