Downloads · 30 days
427
3% of all-time downloads
ai-forever/FRED-T5-large-spell
FRED-T5-large-spell is a machine learning model from ai-forever. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as mit.
The model corrects spelling errors and typos by bringing all the words in the text to the norm of the Russian language. The proofreader was trained based on the FredT5-large model. An extensive dataset with “artificia…
Downloads · 30 days
427
3% of all-time downloads
All-time downloads
16.1K
Public
Parameters
820M
9.8 GB on disk
Likes
7
Public
Click a slice to open those files.
.bin3.3 GB · 50%
From the Hugging Face model README
The model corrects spelling errors and typos by bringing all the words in the text to the norm of the Russian language. The proofreader was trained based on the FredT5-large model. 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 functionality of the SAGE library.
*Examples are given with default generation parameters
| Input | Output |
|---|---|
| Думю ешцъа лет череа 10 ретроспективно просматривотьэ то будкетцц мне невероя тна ин те р но | Думаю еще лет через 10 ретроспективно просматривать это будет мне невероятно интересно. Думаю это лет через 10 ретроспективно просматривать это будет мне невероятно интересно. |
| Основая цель мероприятия - практическая отработка навыков по оказанию помощи гражданам, попавшим в ДТП, а также повышение и совершенствование уровня профессиональной подготовки сотрудников МЧС при проведении аварийно-спасательных работ по ликвидации последствий дорожно-транспортных проишествий, сокращение временных показателей реагирования. | Основная цель мероприятия - практическая отработка навыков по оказанию помощи гражданам, попавшим в ДТП, а также повышение и совершенствование уровня профессиональной подготовки сотрудников МЧС при проведении аварийно-спасательных работ по ликвидации последствий дорожно-транспортных происшествий, сокращение временных показателей реагирования. Основная цель мероприятия |
| прийдя в МГТУ я был удивлен никого необноружив там… | прийдя в МГТУ я был удивлен никого не обнаружив там.. «при |
Below are automatic metrics for determining the correctness of the spell checkers. We compare our solution with both open automatic spell checkers and the ChatGPT family of models on all four available datasets:
RUSpellRU
| Model | Precision | Recall | F1 |
|---|---|---|---|
| FredT5-large-spell | 58.5 | 42.4 | 49.2 |
| ChatGPT gpt-3.5-turbo-0301 | 55.8 | 75.3 | 64.1 |
| ChatGPT gpt-4-0314 | 57.0 | 75.9 | 63.9 |
| ChatGPT text-davinci-003 | 55.9 | 75.3 | 64.2 |
| Yandex.Speller | 83.0 | 59.8 | 69.5 |
| JamSpell | 42.1 | 32.8 | 36.9 |
| HunSpell | 31.3 | 34.9 | 33.0 |
MultidomainGold
| Model | Precision | Recall | F1 |
|---|---|---|---|
| FredT5-large-spell | 42.5 | 42.0 | 42.2 |
| ChatGPT gpt-3.5-turbo-0301 | 33.8 | 72.1 | 46.0 |
| ChatGPT gpt-4-0314 | 34.0 | 73.2 | 46.4 |
| ChatGPT text-davinci-003 | 33.6 | 72.0 | 45.8 |
| Yandex.Speller | 52.9 | 51.4 | 52.2 |
| JamSpell | 25.7 | 30.6 | 28.0 |
| HunSpell | 16.2 | 40.1 | 23.0 |
MedSpellChecker
| Model | Precision | Recall | F1 |
|---|---|---|---|
| FredT5-large-spell | 37.2 | 51.7 | 43.3 |
| ChatGPT gpt-3.5-turbo-0301 | 53.2 | 67.6 | 59.6 |
| ChatGPT gpt-4-0314 | 54.2 | 69.4 | 60.9 |
| ChatGPT text-davinci-003 | 47.8 | 68.4 | 56.3 |
| Yandex.Speller | 80.6 | 47.8 | 60.0 |
| JamSpell | 24.6 | 29.7 | 26.9 |
| HunSpell | 10.3 | 40.2 | 16.4 |
GitHubTypoCorpusRu
| Model | Precision | Recall | F1 |
|---|---|---|---|
| FredT5-large-spell | 52.7 | 41.7 | 46.6 |
| ChatGPT gpt-3.5-turbo-0301 | 43.8 | 57.0 | 49.6 |
| ChatGPT gpt-4-0314 | 45.2 | 58.2 | 51.0 |
| ChatGPT text-davinci-003 | 46.5 | 58.1 | 51.7 |
| Yandex.Speller | 67.7 | 37.5 | 48.3 |
| JamSpell | 49.5 | 29.9 | 37.3 |
| HunSpell | 28.5 | 30.7 | 29.6 |
from transformers import T5ForConditionalGeneration, AutoTokenizer
path_to_model = "ai-forever/FRED-T5-large-spell"
model = T5ForConditionalGeneration.from_pretrained(path_to_model)
tokenizer = AutoTokenizer.from_pretrained(path_to_model, eos_token="</s>")
prefix = "Исправь: "
sentence = "прийдя в МГТУ я был удивлен никого необноружив там…"
sentence = prefix + sentence
encodings = tokenizer(sentence, return_tensors="pt")
generated_tokens = model.generate(
**encodings, eos_token_id=tokenizer.eos_token_id, early_stopping=True)
answer = tokenizer.batch_decode(generated_tokens, skip_special_tokens=True)
print(answer)
# ["прийдя в МГТУ я был удивлен никого не обнаружив там.. «при"]
Model FRED-T5-large, on the basis of which our solution is made, and its source code are supplied under the APACHE-2.0 license. Our solution also comes with MIT license.