Downloads · 30 days
2
1% of all-time downloads
AventIQ-AI/t5-base-grammar-correction-for-writing-assistance
t5-base-grammar-correction-for-writing-assistance is a machine learning model from AventIQ-AI. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This repository contains a fine-tuned T5-base transformer model designed for grammatical error correction, optimized for writing assistance applications. The model identifies and corrects grammar issues in English sen…
Downloads · 30 days
2
1% of all-time downloads
All-time downloads
154
Public
Parameters
223M
447 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors446 MB · 100%
From the Hugging Face model README
This repository contains a fine-tuned T5-base transformer model designed for grammatical error correction, optimized for writing assistance applications. The model identifies and corrects grammar issues in English sentences to improve fluency, clarity, and correctness.
pip install datasets transformers evaluate
from transformers import T5Tokenizer, T5ForConditionalGeneration
model_name = "t5-base"
tokenizer = T5Tokenizer.from_pretrained(model_name)
model = T5ForConditionalGeneration.from_pretrained("path/to/your/fine-tuned-model")
def correct_grammar(text, max_length=128):
input_text = "fix: " + text
inputs = tokenizer(input_text, return_tensors="pt", truncation=True, padding=True).to(model.device)
output_ids = model.generate(inputs['input_ids'], max_length=max_length)
return tokenizer.decode(output_ids[0], skip_special_tokens=True)
The model was fine-tuned on the JFLEG dataset (via Hugging Face), a benchmark for fluency-based grammatical error correction. Each entry contains:
The dataset was split into train and validation sets using a 90/10 split ratio.
epocht5-base.
├── config.json
├── tokenizer_config.json
├── special_tokens_map.json
├── tokenizer.json
├── model.safetensors # Fine-Tuned Model
├── README.md # Model documentation
Contributions and suggestions are welcome! Please open an issue or submit a pull request for improvements or extensions (e.g., multilingual support, UI integration).