Update README.md
Browse files
README.md
CHANGED
@@ -7,4 +7,21 @@ datasets:
|
|
7 |
- leslyarun/c4_200m_gec_train100k_test25k
|
8 |
---
|
9 |
|
10 |
-
# Get Grammatical corrections on your English text, trained on a subset of c4-200m dataset
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
- leslyarun/c4_200m_gec_train100k_test25k
|
8 |
---
|
9 |
|
10 |
+
# Get Grammatical corrections on your English text, trained on a subset of c4-200m dataset
|
11 |
+
|
12 |
+
# Use the below code for running the model
|
13 |
+
|
14 |
+
``` python
|
15 |
+
|
16 |
+
|
17 |
+
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
18 |
+
from transformers import pipeline
|
19 |
+
|
20 |
+
tokenizer = AutoTokenizer.from_pretrained("leslyarun/grammatical-error-correction")
|
21 |
+
model = AutoModelForSeq2SeqLM.from_pretrained("leslyarun/grammatical-error-correction")
|
22 |
+
|
23 |
+
text2text_generator = pipeline("text2text-generation", model=model, tokenizer=tokenizer)
|
24 |
+
output = text2text_generator("grammar: " + sentence)
|
25 |
+
print(output[0]["generated_text"])
|
26 |
+
|
27 |
+
```
|