English Grammar Correction model

Quick Start (Python)

Installation

pip install transformers torch

Basic Usage

from transformers import T5Tokenizer, T5ForConditionalGeneration
import torch

# Load model and tokenizer
model_name = "yoon-eunbin/t5-gec-model"
tokenizer = T5Tokenizer.from_pretrained(model_name)
model = T5ForConditionalGeneration.from_pretrained(model_name)

# Set device
device = 'cuda' if torch.cuda.is_available() else 'cpu'
model = model.to(device)

# Prepare input
text = "He has left the room when I came into the room."
inputs = tokenizer(text, return_tensors="pt", padding=True, truncation=True, max_length=64).to(device)

# Generate correction
outputs = model.generate(**inputs, max_length=64)

# Decode output
corrected_text = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(f"Original: {text}")
print(f"Corrected: {corrected_text}")
Downloads last month
27
Safetensors
Model size
0.2B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for yoon-eunbin/t5-gec-model

Base model

google-t5/t5-base
Finetuned
(718)
this model

Datasets used to train yoon-eunbin/t5-gec-model