Downloads · 30 days
20
19% of all-time downloads
vagmi/grammar-t5
grammar-t5 is a machine learning model from vagmi. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as apache-2.0.
This is my first model for grammar error correction. It uses the jfleg dataset and is built on t5-base. It is trained only for 3 epochs so the output isn't that great.
Downloads · 30 days
20
19% of all-time downloads
All-time downloads
105
Public
Parameters
223M
2.7 GB on disk
Likes
1
Public
Click a slice to open those files.
.bin892 MB · 50%
From the Hugging Face model README
This is my first model for grammar error correction. It uses the jfleg dataset and is built on t5-base. It is trained only for 3 epochs so the output isn't that great.
You can use this model with the standard transformers library. This model should be small enough to run on the CPU.
$ pip install transformers torch sentencepiece
Once you have the dependencies setup, you should be able to run this model.
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
model_name = 'vagmi/grammar-t5'
model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
tokenizer = AutoTokenizer.from_pretrained(model_name)
text = 'fix grammar: I am work with machine to write gooder english.'
inputs = tokenizer(text, return_tensors='pt')
outputs = model.generate(inputs['input_ids'], num_beams=2, max_length=512, early_stopping=True)
fixed = tokenizer.decode(outputs[0], skip_special_tokens=True)
# I am working with machine to write better english.