File size: 1,240 Bytes
d8929a4
 
 
 
 
 
 
60afeea
d8929a4
 
3aba311
d8929a4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
---
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


```