The model corrects spelling errors and typos in both Russian and English languages by bringing all the words in the text to the norm of the language.
Corrector had been trained based on the model
mT5-large
architecture.
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
.
Перведи мне текст на аглиском: "Screw you kuys, I am goin hme (c).
Переведи мне текст на английском: "Screw you guys, I am going home" (c).
И не чсно прохожим в этот день непогожйи почему я веселый такйо
И мне ясно прохожим в этот день непогожий, почему я веселый такой
If you bought something goregous, you well be very happy.
If you bought something gorgeous, you will be very happy.
Metrics
Quality
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 six available datasets:
RUSpellRU
: texts collected from (
LiveJournal
), with manually corrected typos and errors;
MultidomainGold
: examples from 7 text sources, including the open web, news, social media, reviews, subtitles, policy documents and literary works;
MedSpellChecker
: texts with errors from medical anamnesis;
GitHubTypoCorpusRu
: spelling errors and typos in commits from
GitHub
;
BEA60K
: English spelling errors collected from several domains;
JFLEG
: 1601 sentences in English, which contain about 2 thousand spelling errors;
RUSpellRU, MultidomainGold, MedSpellChecker, GitHubTypoCorpusRu are datasets for the Russian spellchecking and BEA60K and JFLEG are those for the English language.
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
tokenizer = AutoTokenizer.from_pretrained("ai-forever/sage-mt5-large")
model = AutoModelForSeq2SeqLM.from_pretrained("ai-forever/sage-mt5-large", device_map='cuda')
sentence = "Перведи мне текст на аглиском: \"Screw you kuys, I am goin hme (c)."
inputs = tokenizer(sentence, max_length=None, padding="longest", truncation=False, return_tensors="pt")
outputs = model.generate(**inputs.to(model.device), max_length = inputs["input_ids"].size(1) * 1.5)
print(tokenizer.batch_decode(outputs, skip_special_tokens=True))
# ["Переведи мне текст на английском: "Screw you guys, I am going home" (c)."]
Limitations
For the Russian language the model is intended to be fine-tuned for better performance.
Model
mT5-large
, on the basis of which our solution is made, and its source code are supplied under the Apache-2.0 license.
Our solution comes with MIT license.
sage-mt5-large huggingface.co is an AI model on huggingface.co that provides sage-mt5-large's model effect (), which can be used instantly with this ai-forever sage-mt5-large model. huggingface.co supports a free trial of the sage-mt5-large model, and also provides paid use of the sage-mt5-large. Support call sage-mt5-large model through api, including Node.js, Python, http.
sage-mt5-large huggingface.co is an online trial and call api platform, which integrates sage-mt5-large's modeling effects, including api services, and provides a free online trial of sage-mt5-large, you can try sage-mt5-large online for free by clicking the link below.
ai-forever sage-mt5-large online free url in huggingface.co:
sage-mt5-large is an open source model from GitHub that offers a free installation service, and any user can find sage-mt5-large on GitHub to install. At the same time, huggingface.co provides the effect of sage-mt5-large install, users can directly use sage-mt5-large installed effect in huggingface.co for debugging and trial. It also supports api for free installation.