← all repositories
grammarly/gector

Grammar correction that tags instead of generating

GECToR reframes grammar fixing and text simplification as token-tagging problems over pre-trained transformers, trading the slow autoregressive rewrite loop for a single fast pass.

971 stars Python Language ModelsDomain Apps
gector
Not currently ranked — collecting fresh signals.
star history

What it does

This is the official implementation of GECToR, a grammatical error correction and text simplification system that assigns each input token a transformation label rather than drafting corrected text from scratch. It wraps pre-trained Transformer encoders inside an AllenNLP pipeline and ships with ready-made checkpoints for BERT, RoBERTa, and XLNet.

The interesting bit

Most grammar tools behave like ghostwriters that draft entire sentences; GECToR behaves like a copyeditor with a red pen, applying token-level transformation labels to the original text. Because the model is fully non-autoregressive, the authors report inference up to 10× faster than Transformer seq2seq systems for grammar correction, and over 11× faster for text simplification.

Key highlights

  • Approaches GEC and text simplification as sequence-labeling tasks over pre-trained encoders rather than generation problems
  • Pretrained models available for BERT, RoBERTa, and XLNet with published F0.5 and SARI scores on CoNLL-2014, BEA-2019, and ASSET benchmarks
  • Two-stage fine-tuning: first on errorful corpora, then on a mix of errorful and error-free parallel data
  • Inference tuned with confidence bias and minimum error probability thresholds that act as precision-recall dials
  • Single codebase covers both grammar correction and text simplification via the same tagging interface

Caveats

  • The reported benchmark scores differ slightly from the original papers because the codebase was upgraded to a newer transformers release; reproducing exact paper numbers requires an older commit
  • The project was last validated on Python 3.7, so running it on modern environments may demand dependency adjustments

Verdict

Grab it if you need a fast, non-autoregressive baseline for grammar correction or simplification research. Pass if you want a polished product API or a seq2seq model that freely rewrites entire phrases.

Frequently asked

What is grammarly/gector?
GECToR reframes grammar fixing and text simplification as token-tagging problems over pre-trained transformers, trading the slow autoregressive rewrite loop for a single fast pass.
Is gector open source?
Yes — grammarly/gector is open source, released under the Apache-2.0 license.
What language is gector written in?
grammarly/gector is primarily written in Python.
How popular is gector?
grammarly/gector has 971 stars on GitHub.
Where can I find gector?
grammarly/gector is on GitHub at https://github.com/grammarly/gector.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.