ai-forever
commited on
Commit
•
6b6b533
1
Parent(s):
382bd51
Update README.md
Browse files
README.md
CHANGED
@@ -21,7 +21,6 @@ An extensive dataset with “artificial” errors was taken as a training corpus
|
|
21 |
- [SAGE library announcement](https://youtu.be/yFfkV0Qjuu0), DataFest 2023
|
22 |
- [Paper about synthetic error generation methods](https://www.dialog-21.ru/media/5914/martynovnplusetal056.pdf), Dialogue 2023
|
23 |
- [Paper about SAGE and our best solution](https://arxiv.org/abs/2308.09435), Review EACL 2024
|
24 |
-
- Path to model = "ai-forever/T5-large-spell"
|
25 |
|
26 |
### Examples
|
27 |
| Input | Output |
|
@@ -61,14 +60,14 @@ We present a comparison of our solution both with open automatic spell checkers
|
|
61 |
```python
|
62 |
from transformers import T5ForConditionalGeneration, AutoTokenizer
|
63 |
|
64 |
-
path_to_model = "
|
65 |
|
66 |
model = T5ForConditionalGeneration.from_pretrained(path_to_model)
|
67 |
tokenizer = AutoTokenizer.from_pretrained(path_to_model)
|
68 |
prefix = "grammar: "
|
69 |
|
70 |
sentence = "If you bought something goregous, you well be very happy."
|
71 |
-
sentence = prefix +
|
72 |
|
73 |
encodings = tokenizer(sentence, return_tensors="pt")
|
74 |
generated_tokens = model.generate(**encodings)
|
|
|
21 |
- [SAGE library announcement](https://youtu.be/yFfkV0Qjuu0), DataFest 2023
|
22 |
- [Paper about synthetic error generation methods](https://www.dialog-21.ru/media/5914/martynovnplusetal056.pdf), Dialogue 2023
|
23 |
- [Paper about SAGE and our best solution](https://arxiv.org/abs/2308.09435), Review EACL 2024
|
|
|
24 |
|
25 |
### Examples
|
26 |
| Input | Output |
|
|
|
60 |
```python
|
61 |
from transformers import T5ForConditionalGeneration, AutoTokenizer
|
62 |
|
63 |
+
path_to_model = "ai-forever/T5-large-spell"
|
64 |
|
65 |
model = T5ForConditionalGeneration.from_pretrained(path_to_model)
|
66 |
tokenizer = AutoTokenizer.from_pretrained(path_to_model)
|
67 |
prefix = "grammar: "
|
68 |
|
69 |
sentence = "If you bought something goregous, you well be very happy."
|
70 |
+
sentence = prefix + sentence
|
71 |
|
72 |
encodings = tokenizer(sentence, return_tensors="pt")
|
73 |
generated_tokens = model.generate(**encodings)
|