Upload README
Browse files
README.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language: en
|
| 3 |
+
license: apache-2.0
|
| 4 |
+
tags:
|
| 5 |
+
- text2text-generation
|
| 6 |
+
- t5
|
| 7 |
+
- grammar-correction
|
| 8 |
+
- text-correction
|
| 9 |
+
---
|
| 10 |
+
|
| 11 |
+
# T5-Base Fine-tuned for Grammar Correction
|
| 12 |
+
|
| 13 |
+
This is a fine-tuned T5-base model for grammar correction tasks.
|
| 14 |
+
|
| 15 |
+
## Usage
|
| 16 |
+
|
| 17 |
+
```python
|
| 18 |
+
from transformers import T5ForConditionalGeneration, T5Tokenizer
|
| 19 |
+
|
| 20 |
+
model = T5ForConditionalGeneration.from_pretrained("MdSourav76046/t5-base-grammar-correction")
|
| 21 |
+
tokenizer = T5Tokenizer.from_pretrained("MdSourav76046/t5-base-grammar-correction")
|
| 22 |
+
|
| 23 |
+
# Example usage
|
| 24 |
+
input_text = "correct: The studnet are studing hard for there exams"
|
| 25 |
+
inputs = tokenizer(input_text, return_tensors="pt", max_length=96, truncation=True)
|
| 26 |
+
outputs = model.generate(**inputs, max_length=128, num_beams=3, early_stopping=True)
|
| 27 |
+
corrected_text = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 28 |
+
print(corrected_text)
|
| 29 |
+
```
|