Upload README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
|
| 3 |
+
language: en
|
| 4 |
+
|
| 5 |
+
tags:
|
| 6 |
+
|
| 7 |
+
- sentence correction
|
| 8 |
+
|
| 9 |
+
- text-generation
|
| 10 |
+
|
| 11 |
+
license: cc-by-nc-sa-4.0
|
| 12 |
+
|
| 13 |
+
datasets:
|
| 14 |
+
|
| 15 |
+
- jfleg
|
| 16 |
+
|
| 17 |
+
---
|
| 18 |
+
|
| 19 |
+
# Model
|
| 20 |
+
This model utilises T5-base sentence correction pre-trained model. It was fine tuned using [JFLEG](https://arxiv.org/abs/1702.04066) dataset and [Happy Transformer framework](https://github.com/EricFillion/happy-transformer). This model was pre-trained for educational purposes only for correction on local caribbean dialect.
|
| 21 |
+
.
|
| 22 |
+
___
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
# Re-training/Fine Tuning
|
| 26 |
+
|
| 27 |
+
The results of fine-tuning resulted in a finally accuracy of 90%
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
# Usage
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
```python
|
| 35 |
+
|
| 36 |
+
from happytransformer import HappyTextToText, TTSettings
|
| 37 |
+
|
| 38 |
+
pre_trained_model="T5"
|
| 39 |
+
model = HappyTextToText(pre_trained_model, "KES/T5-KES")
|
| 40 |
+
|
| 41 |
+
arguments = TTSettings(num_beams=4, min_length=1)
|
| 42 |
+
sentence = "Wat iz your nam"
|
| 43 |
+
|
| 44 |
+
correction = model.generate_text("grammar: "+sentence, args=arguments)
|
| 45 |
+
if(result.text.find(" .")):
|
| 46 |
+
result.text=result.text.replace(" .", ".")
|
| 47 |
+
|
| 48 |
+
print(result.text) # Correction: "What is your name?".
|
| 49 |
+
|
| 50 |
+
```
|