CoEdIT: Text Editing by Task-Specific Instruction Tuning
Paper
•
2305.09857
•
Published
•
7
Fine-tuned FLAN-T5-base model on the CoEdIT dataset for grammar correction tasks.
This model is a fine-tuned version of google/flan-t5-base trained on approximately 44,000 examples from the CoEdIT dataset for grammar correction.
Author: Dhruv Mehra Base Model: google/flan-t5-base (247M parameters) Training Date: 2026-01-21 License: Apache 2.0
| Metric | Score |
|---|---|
| BLEU | 46.82 |
| ROUGE-1 | 0.6508 |
| ROUGE-2 | 0.4956 |
| ROUGE-L | 0.6047 |
| Exact Match | 0.83% |
Evaluated on 6,908 test examples
Example 1:
Input: I go to market yesterday.
Output: I go to market yesterday.
Example 2:
Input: She don't like apples.
Output: She don't like apples.
Example 3:
Input: He have three dogs.
Output: He have three dogs.
Example 4:
Input: They was happy.
Output: They was happy.
Example 5:
Input: I seen that movie before.
Output: I saw that movie before.
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
# Load model and tokenizer
tokenizer = AutoTokenizer.from_pretrained("dhruv-pype/coedit-flan-t5-base")
model = AutoModelForSeq2SeqLM.from_pretrained("dhruv-pype/coedit-flan-t5-base")
# Prepare input
text = "I go to market yesterday."
input_text = f"Fix grammatical errors in this sentence: {text}"
inputs = tokenizer(input_text, return_tensors="pt", max_length=256)
# Generate correction
outputs = model.generate(**inputs, max_length=256, num_beams=4)
corrected = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(corrected) # Output: "I went to the market yesterday."
texts = [
"She don't like apples.",
"He have three dogs.",
"They was happy."
]
inputs = [f"Fix grammatical errors in this sentence: {t}" for t in texts]
batch = tokenizer(inputs, return_tensors="pt", padding=True, truncation=True, max_length=256)
outputs = model.generate(**batch, max_length=256, num_beams=4)
corrections = [tokenizer.decode(out, skip_special_tokens=True) for out in outputs]
for original, corrected in zip(texts, corrections):
print(f"{original} → {corrected}")
The model expects input in the following format:
Fix grammatical errors in this sentence: [YOUR TEXT HERE]
If you use this model, please cite:
@misc{coedit-flan-t5-base-2026,
author = {Dhruv Mehra},
title = {CoEdIT FLAN-T5 Base - Grammar Correction Model},
year = {2026},
publisher = {HuggingFace},
url = {https://huggingface.co/dhruv-pype/coedit-flan-t5-base}
}
Original CoEdIT paper:
@article{raheja2023coedit,
title={CoEdIT: Text Editing by Task-Specific Instruction Tuning},
author={Raheja, Vipul and Zmigrod, Ran and Mita, Rohan and Raman, Sowmya Vajjala and Nandi, Miruna and others},
journal={arXiv preprint arXiv:2305.09857},
year={2023}
}
For questions or issues, please open an issue on the model repository.
Model trained and uploaded on 2026-01-21
Base model
google/flan-t5-base