ai-forever
commited on
Commit
•
09ab83d
1
Parent(s):
a6d30cb
Update README.md
Browse files
README.md
CHANGED
@@ -12,7 +12,7 @@ metrics:
|
|
12 |
- f1
|
13 |
library_name: transformers
|
14 |
model-index:
|
15 |
-
- name: sage-fredt5-
|
16 |
results:
|
17 |
- task:
|
18 |
type: text-generation
|
@@ -22,15 +22,15 @@ model-index:
|
|
22 |
metrics:
|
23 |
- name: F1 (spell)
|
24 |
type: f1_spell
|
25 |
-
value:
|
26 |
verified: false
|
27 |
- name: F1 (punct)
|
28 |
type: f1_punct
|
29 |
-
value:
|
30 |
verified: false
|
31 |
- name: F1 (case)
|
32 |
type: f1_case
|
33 |
-
value:
|
34 |
verified: false
|
35 |
- task:
|
36 |
type: text-generation
|
@@ -40,15 +40,15 @@ model-index:
|
|
40 |
metrics:
|
41 |
- name: F1 (spell)
|
42 |
type: f1_spell
|
43 |
-
value:
|
44 |
verified: false
|
45 |
- name: F1 (punct)
|
46 |
type: f1_punct
|
47 |
-
value:
|
48 |
verified: false
|
49 |
- name: F1 (case)
|
50 |
type: f1_case
|
51 |
-
value:
|
52 |
verified: false
|
53 |
- task:
|
54 |
type: text-generation
|
@@ -58,15 +58,15 @@ model-index:
|
|
58 |
metrics:
|
59 |
- name: F1 (spell)
|
60 |
type: f1_spell
|
61 |
-
value:
|
62 |
verified: false
|
63 |
- name: F1 (punct)
|
64 |
type: f1_punct
|
65 |
-
value:
|
66 |
verified: false
|
67 |
- name: F1 (case)
|
68 |
type: f1_case
|
69 |
-
value:
|
70 |
verified: false
|
71 |
- task:
|
72 |
type: text-generation
|
@@ -76,25 +76,25 @@ model-index:
|
|
76 |
metrics:
|
77 |
- name: F1 (spell)
|
78 |
type: f1_spell
|
79 |
-
value:
|
80 |
verified: false
|
81 |
- name: F1 (punct)
|
82 |
type: f1_punct
|
83 |
-
value:
|
84 |
verified: false
|
85 |
- name: F1 (case)
|
86 |
type: f1_case
|
87 |
-
value:
|
88 |
verified: false
|
89 |
---
|
90 |
-
# sage-fredt5-
|
91 |
|
92 |
![banner](images/sage_banner.jpg)
|
93 |
|
94 |
## Summary
|
95 |
|
96 |
The model corrects spelling and punctuation errors and typos by bringing all the words in the text to the norm of the Russian language.
|
97 |
-
Corrector had been trained based on the
|
98 |
An extensive dataset with “artificial” errors was taken as a training corpus: the corpus was assembled on the basis of the Russian-language Wikipedia and transcripts of Russian-language videos, then typos and spelling errors were automatically introduced into it using the library [SAGE](https://github.com/ai-forever/sage).
|
99 |
|
100 |
## Public references
|
@@ -106,9 +106,9 @@ An extensive dataset with “artificial” errors was taken as a training corpus
|
|
106 |
## Examples
|
107 |
| Input | Output |
|
108 |
| --- | --- |
|
109 |
-
| И не чсно прохожим в этот день непогожйи почему я веселый такйо | И не ясно прохожим в этот день непогожий, почему я
|
110 |
-
| Каждй день воттак делой, и спена балеть нибудет. А вотак каждый день ниделай | Каждый день вот так
|
111 |
-
| Основая цель мероприятия практическая отработка навыков по оказанию помощи гражданам, попавшим в ДТП а также повышение и совершенствование уровня профессиональной подготовки сотрудников МЧС при проведении аварийно-спасательных работ по ликвидации последствий дорожно-транспортных проишествий сокращение временных показателей реагирования. | Основная цель мероприятия
|
112 |
| | |
|
113 |
|
114 |
## Metrics
|
@@ -123,8 +123,7 @@ We compare our solution with both open automatic spell checkers and the ChatGPT
|
|
123 |
**RUSpellRU**
|
124 |
| Model | Pr. (spell) | Rec. (spell) | F1 (spell) | Pr. (punc) | Rec. (punc) | F1 (punc) | Pr. (case) | Rec. (case) | F1 (case) |
|
125 |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
|
126 |
-
| sage-fredt5-
|
127 |
-
| sage-fredt5-large (ft) | 88.4 | 80.9 | 84.5 | 88.2 | 85.3 | 86.8 | 95.5 | 94.0 | 94.7 |
|
128 |
| sage-ai-service | 90.3 | 86.3 | 88.2 | 90.3 | 86.6 | 88.4 | 95.2 | 95.9 | 95.6 |
|
129 |
| gpt-3.5-turbo | 33.6 | 58.5 | 42.7 | 85.9 | 64.6 | 73.7 | 84.9 | 73.9 | 79.0 |
|
130 |
| gpt-4 | 54.9 | 76.7 | 64.0 | 84.0 | 82.3 | 83.2 | 91.5 | 90.2 | 90.9 |
|
@@ -133,8 +132,7 @@ We compare our solution with both open automatic spell checkers and the ChatGPT
|
|
133 |
**MultidomainGold**
|
134 |
| Model | Pr. (spell) | Rec. (spell) | F1 (spell) | Pr. (punc) | Rec. (punc) | F1 (punc) | Pr. (case) | Rec. (case) | F1 (case) |
|
135 |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
|
136 |
-
| sage-fredt5-
|
137 |
-
| sage-fredt5-large (ft) | 80.3 | 75.1 | 77.6 | 69.0 | 66.5 | 67.7 | 78.6 | 80.0 | 79.3 |
|
138 |
| sage-ai-service | 81.6 | 77.7 | 79.6 | 70.2 | 67.5 | 68.8 | 80.5 | 80.5 | 80.5 |
|
139 |
| gpt-3.5-turbo | 18.8 | 48.1 | 27.1 | 42.0 | 31.8 | 36.2 | 47.1 | 51.3 | 49.1 |
|
140 |
| gpt-4 | 25.4 | 68.0 | 37.0 | 57.8 | 54.3 | 56.0 | 54.0 | 67.5 | 60.0 |
|
@@ -143,8 +141,7 @@ We compare our solution with both open automatic spell checkers and the ChatGPT
|
|
143 |
**MedSpellChecker**
|
144 |
| Model | Pr. (spell) | Rec. (spell) | F1 (spell) | Pr. (punc) | Rec. (punc) | F1 (punc) | Pr. (case) | Rec. (case) | F1 (case) |
|
145 |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
|
146 |
-
| sage-fredt5-
|
147 |
-
| sage-fredt5-large (ft) | 72.5 | 72.2 | 72.3 | 74.6 | 66.4 | 70.3 | 79.3 | 85.1 | 82.1 |
|
148 |
| sage-ai-service | 71.3 | 73.5 | 72.4 | 75.1 | 69.2 | 72.0 | 80.9 | 72.8 | 76.6|
|
149 |
| gpt-3.5-turbo | 14.7 | 45.9 | 22.3 | 69.9 | 52.3 | 59.8 | 26.4 | 41.8 | 32.3 |
|
150 |
| gpt-4 | 37.8 | 72.3 | 49.6 | 81.4 | 64.3 | 71.9 | 73.0 | 62.1 | 67.1 |
|
@@ -153,18 +150,20 @@ We compare our solution with both open automatic spell checkers and the ChatGPT
|
|
153 |
**GitHubTypoCorpusRu**
|
154 |
| Model | Pr. (spell) | Rec. (spell) | F1 (spell) | Pr. (punc) | Rec. (punc) | F1 (punc) | Pr. (case) | Rec. (case) | F1 (case) |
|
155 |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
|
156 |
-
| sage-fredt5-
|
157 |
-
| sage-fredt5-large (ft) | 67.5 | 53.2 | 59.5 | 48.5 | 38.0 | 42.6 | 37.3 | 50.0 | 42.7 |
|
158 |
| sage-ai-service | 70.8 | 56.3 | 62.7 | 48.9 | 35.8 | 41.4 | 32.9 | 45.3 | 38.1|
|
159 |
| gpt-3.5-turbo | 23.7 | 38.7 | 29.4 | 37.6 | 23.3 | 28.7 | 19.6 | 35.9 | 25.3 |
|
160 |
| gpt-4 | 27.0 | 52.8 | 35.7 | 45.9 | 32.6 | 38.2 | 25.7 | 36.8 | 30.2 |
|
161 |
|
|
|
162 |
## How to use
|
163 |
```python
|
164 |
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
165 |
-
|
166 |
-
|
|
|
167 |
model.to("cuda:0")
|
|
|
168 |
sentence = "И не чсно прохожим в этот день непогожйи почему я веселый такйо"
|
169 |
text = "<LM>" + sentence
|
170 |
with torch.inference_mode():
|
@@ -178,12 +177,12 @@ with torch.inference_mode():
|
|
178 |
)
|
179 |
res = res.cpu().tolist()
|
180 |
res = tokenizer.batch_decode(res, skip_special_tokens=True)
|
|
|
181 |
print(res)
|
182 |
-
# ["И не ясно прохожим в этот день непогожий, почему я
|
183 |
```
|
184 |
|
185 |
## Limitations
|
186 |
-
- The model is intended to be fine-tuned on sets with natural errors for better performance. The realized model is a pre-train and pre-train task is different from the usual spell checking in terms of density of the noise in a corpus and its origin;
|
187 |
- Complex formatting may cause some trouble in output generation.
|
188 |
|
189 |
## Resources
|
@@ -194,7 +193,7 @@ print(res)
|
|
194 |
- [sage-mt5-large](https://huggingface.co/ai-forever/sage-mt5-large), HuggingFace
|
195 |
|
196 |
## License
|
197 |
-
Model [FRED-T5-
|
198 |
Our solution comes with MIT license also.
|
199 |
|
200 |
## Specifications
|
|
|
12 |
- f1
|
13 |
library_name: transformers
|
14 |
model-index:
|
15 |
+
- name: sage-fredt5-distilled-95m
|
16 |
results:
|
17 |
- task:
|
18 |
type: text-generation
|
|
|
22 |
metrics:
|
23 |
- name: F1 (spell)
|
24 |
type: f1_spell
|
25 |
+
value: 78.9
|
26 |
verified: false
|
27 |
- name: F1 (punct)
|
28 |
type: f1_punct
|
29 |
+
value: 83.6
|
30 |
verified: false
|
31 |
- name: F1 (case)
|
32 |
type: f1_case
|
33 |
+
value: 93.5
|
34 |
verified: false
|
35 |
- task:
|
36 |
type: text-generation
|
|
|
40 |
metrics:
|
41 |
- name: F1 (spell)
|
42 |
type: f1_spell
|
43 |
+
value: 73.4
|
44 |
verified: false
|
45 |
- name: F1 (punct)
|
46 |
type: f1_punct
|
47 |
+
value: 65.0
|
48 |
verified: false
|
49 |
- name: F1 (case)
|
50 |
type: f1_case
|
51 |
+
value: 77.9
|
52 |
verified: false
|
53 |
- task:
|
54 |
type: text-generation
|
|
|
58 |
metrics:
|
59 |
- name: F1 (spell)
|
60 |
type: f1_spell
|
61 |
+
value: 64.9
|
62 |
verified: false
|
63 |
- name: F1 (punct)
|
64 |
type: f1_punct
|
65 |
+
value: 70.0
|
66 |
verified: false
|
67 |
- name: F1 (case)
|
68 |
type: f1_case
|
69 |
+
value: 68.7
|
70 |
verified: false
|
71 |
- task:
|
72 |
type: text-generation
|
|
|
76 |
metrics:
|
77 |
- name: F1 (spell)
|
78 |
type: f1_spell
|
79 |
+
value: 52.7
|
80 |
verified: false
|
81 |
- name: F1 (punct)
|
82 |
type: f1_punct
|
83 |
+
value: 42.1
|
84 |
verified: false
|
85 |
- name: F1 (case)
|
86 |
type: f1_case
|
87 |
+
value: 36.3
|
88 |
verified: false
|
89 |
---
|
90 |
+
# sage-fredt5-distilled-95m
|
91 |
|
92 |
![banner](images/sage_banner.jpg)
|
93 |
|
94 |
## Summary
|
95 |
|
96 |
The model corrects spelling and punctuation errors and typos by bringing all the words in the text to the norm of the Russian language.
|
97 |
+
Corrector is a distilled version of the original model that had been trained based on the [FRED-T5-1.7B](https://huggingface.co/ai-forever/FRED-T5-1.7B) architecture.
|
98 |
An extensive dataset with “artificial” errors was taken as a training corpus: the corpus was assembled on the basis of the Russian-language Wikipedia and transcripts of Russian-language videos, then typos and spelling errors were automatically introduced into it using the library [SAGE](https://github.com/ai-forever/sage).
|
99 |
|
100 |
## Public references
|
|
|
106 |
## Examples
|
107 |
| Input | Output |
|
108 |
| --- | --- |
|
109 |
+
| И не чсно прохожим в этот день непогожйи почему я веселый такйо | И не ясно прохожим в этот день непогожий, почему я весёлый такой? |
|
110 |
+
| Каждй день воттак делой, и спена балеть нибудет. А вотак каждый день ниделай | Каждый день вот так делай, и спена болеть не будет. А вот так каждый день — ни делай. |
|
111 |
+
| Основая цель мероприятия практическая отработка навыков по оказанию помощи гражданам, попавшим в ДТП а также повышение и совершенствование уровня профессиональной подготовки сотрудников МЧС при проведении аварийно-спасательных работ по ликвидации последствий дорожно-транспортных проишествий сокращение временных показателей реагирования. | Основная цель мероприятия - практическая отработка навыков по оказанию помощи гражданам, попавшим в ДТП, а также повышение и совершенствование уровня профессиональной подготовки сотрудников МЧС при проведении аварийно-спасательных работ по ликвидации последствий дорожно-транспортных происшествий, сокращение временных показателей реагирования. |
|
112 |
| | |
|
113 |
|
114 |
## Metrics
|
|
|
123 |
**RUSpellRU**
|
124 |
| Model | Pr. (spell) | Rec. (spell) | F1 (spell) | Pr. (punc) | Rec. (punc) | F1 (punc) | Pr. (case) | Rec. (case) | F1 (case) |
|
125 |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
|
126 |
+
| sage-fredt5-distilled-95m | 83.5 | 74.8 | 78.9 | 86.8 | 80.6 | 83.6 | 94.4 | 92.5 | 93.5 |
|
|
|
127 |
| sage-ai-service | 90.3 | 86.3 | 88.2 | 90.3 | 86.6 | 88.4 | 95.2 | 95.9 | 95.6 |
|
128 |
| gpt-3.5-turbo | 33.6 | 58.5 | 42.7 | 85.9 | 64.6 | 73.7 | 84.9 | 73.9 | 79.0 |
|
129 |
| gpt-4 | 54.9 | 76.7 | 64.0 | 84.0 | 82.3 | 83.2 | 91.5 | 90.2 | 90.9 |
|
|
|
132 |
**MultidomainGold**
|
133 |
| Model | Pr. (spell) | Rec. (spell) | F1 (spell) | Pr. (punc) | Rec. (punc) | F1 (punc) | Pr. (case) | Rec. (case) | F1 (case) |
|
134 |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
|
135 |
+
| sage-fredt5-distilled-95m | 77.2 | 69.9 | 73.4 | 66.8 | 63.4 | 65.0 | 76.8 | 79.1 | 77.9 |
|
|
|
136 |
| sage-ai-service | 81.6 | 77.7 | 79.6 | 70.2 | 67.5 | 68.8 | 80.5 | 80.5 | 80.5 |
|
137 |
| gpt-3.5-turbo | 18.8 | 48.1 | 27.1 | 42.0 | 31.8 | 36.2 | 47.1 | 51.3 | 49.1 |
|
138 |
| gpt-4 | 25.4 | 68.0 | 37.0 | 57.8 | 54.3 | 56.0 | 54.0 | 67.5 | 60.0 |
|
|
|
141 |
**MedSpellChecker**
|
142 |
| Model | Pr. (spell) | Rec. (spell) | F1 (spell) | Pr. (punc) | Rec. (punc) | F1 (punc) | Pr. (case) | Rec. (case) | F1 (case) |
|
143 |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
|
144 |
+
| sage-fredt5-distilled-95m | 65.1 | 64.8 | 64.9 | 78.6 | 63.1 | 70.0 | 63.5 | 74.7 | 68.7 |
|
|
|
145 |
| sage-ai-service | 71.3 | 73.5 | 72.4 | 75.1 | 69.2 | 72.0 | 80.9 | 72.8 | 76.6|
|
146 |
| gpt-3.5-turbo | 14.7 | 45.9 | 22.3 | 69.9 | 52.3 | 59.8 | 26.4 | 41.8 | 32.3 |
|
147 |
| gpt-4 | 37.8 | 72.3 | 49.6 | 81.4 | 64.3 | 71.9 | 73.0 | 62.1 | 67.1 |
|
|
|
150 |
**GitHubTypoCorpusRu**
|
151 |
| Model | Pr. (spell) | Rec. (spell) | F1 (spell) | Pr. (punc) | Rec. (punc) | F1 (punc) | Pr. (case) | Rec. (case) | F1 (case) |
|
152 |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
|
153 |
+
| sage-fredt5-distilled-95m | 57.8 | 48.5 | 52.7 | 45.2 | 39.5 | 42.1 | 29.9 | 46.2 | 36.3 |
|
|
|
154 |
| sage-ai-service | 70.8 | 56.3 | 62.7 | 48.9 | 35.8 | 41.4 | 32.9 | 45.3 | 38.1|
|
155 |
| gpt-3.5-turbo | 23.7 | 38.7 | 29.4 | 37.6 | 23.3 | 28.7 | 19.6 | 35.9 | 25.3 |
|
156 |
| gpt-4 | 27.0 | 52.8 | 35.7 | 45.9 | 32.6 | 38.2 | 25.7 | 36.8 | 30.2 |
|
157 |
|
158 |
+
|
159 |
## How to use
|
160 |
```python
|
161 |
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
162 |
+
|
163 |
+
tokenizer = AutoTokenizer.from_pretrained("ai-forever/sage-fredt5-distilled-95m")
|
164 |
+
model = AutoModelForSeq2SeqLM.from_pretrained("ai-forever/sage-fredt5-distilled-95m")
|
165 |
model.to("cuda:0")
|
166 |
+
|
167 |
sentence = "И не чсно прохожим в этот день непогожйи почему я веселый такйо"
|
168 |
text = "<LM>" + sentence
|
169 |
with torch.inference_mode():
|
|
|
177 |
)
|
178 |
res = res.cpu().tolist()
|
179 |
res = tokenizer.batch_decode(res, skip_special_tokens=True)
|
180 |
+
|
181 |
print(res)
|
182 |
+
# ["И не ясно прохожим в этот день непогожий, почему я весёлый такой?"]
|
183 |
```
|
184 |
|
185 |
## Limitations
|
|
|
186 |
- Complex formatting may cause some trouble in output generation.
|
187 |
|
188 |
## Resources
|
|
|
193 |
- [sage-mt5-large](https://huggingface.co/ai-forever/sage-mt5-large), HuggingFace
|
194 |
|
195 |
## License
|
196 |
+
Model [FRED-T5-1.7B](https://huggingface.co/ai-forever/FRED-T5-1.7B), on the basis of which our solution is made, and its source code are supplied under the MIT license.
|
197 |
Our solution comes with MIT license also.
|
198 |
|
199 |
## Specifications
|