Instructions to use vennify/t5-base-grammar-correction with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use vennify/t5-base-grammar-correction with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("vennify/t5-base-grammar-correction") model = AutoModelForSeq2SeqLM.from_pretrained("vennify/t5-base-grammar-correction", device_map="auto") - Notebooks
- Google Colab
- Kaggle
|
Download README.md from vennify/t5-base-grammar-correction: direct link, hf CLI and curl.
- Browser
- Download file 939 Bytes
-
https://huggingface.co/vennify/t5-base-grammar-correction/resolve/main/README.md
- Command line
-
hf download hf://vennify/t5-base-grammar-correction/README.md
-
curl -L -o README.md https://huggingface.co/vennify/t5-base-grammar-correction/resolve/main/README.md
939 Bytes
metadata
language: en
tags:
- grammar
- text2text-generation
license: cc-by-nc-sa-4.0
datasets:
- jfleg
T5 Grammar Correction
This model generates a revised version of inputted text with the goal of containing fewer grammatical errors. It was trained with Happy Transformer using a dataset called JFLEG. Here's a full article on how to train a similar model.
Usage
pip install happytransformer
from happytransformer import HappyTextToText, TTSettings
happy_tt = HappyTextToText("T5", "vennify/t5-base-grammar-correction")
args = TTSettings(num_beams=5, min_length=1)
# Add the prefix "grammar: " before each input
result = happy_tt.generate_text("grammar: This sentences has has bads grammar.", args=args)
print(result.text) # This sentence has bad grammar.