fdemelo's picture
Update README.md
3aba311 verified
---
language: fr
tags:
- grammar
- text2text-generation
license: mit
datasets:
- fdemelo/spelling-correction-french-news
---
# T5 Spelling Correction (French)
This model corrects spelling and punctuation problems of the input text (in French).
It was trained on a [synthetic dataset](https://huggingface.co/datasets/fdemelo/spelling-correction-french-news)
based on a French news corpus (2023) provided by the [University of Leipzig](https://wortschatz.uni-leipzig.de/en/download/French)
using [Happy Transformer](https://github.com/EricFillion/happy-transformer).
The base model used for training is [airKlizz/t5-base-multi-fr-wiki-news](https://huggingface.co/airKlizz/t5-base-multi-fr-wiki-news).
The following article was used as reference [full article](https://www.vennify.ai/fine-tune-grammar-correction/).
## Usage
`pip install happytransformer `
```python
from happytransformer import HappyTextToText, TTSettings
happy_tt = HappyTextToText("T5", "fdemelo/t5-base-spell-correction-fr")
args = TTSettings(num_beams=5, min_length=1)
# Add the prefix "grammaire: " before each input
result = happy_tt.generate_text("grammaire: Le vehicule a tombe encontrebas", args=args)
print(result.text) # corrected sentence
```