/ Модель

Характеристики

Контекст
1 024 токена
Параметры
242 млн
Лицензия
CC BY-NC 4.0
Архитектура
mbart · dense
Базовая модель
bartpho-syllable
Библиотека
transformers
Опубликована
4 сен 2026

bartpho-syllable-vi-spellcheck

Генерация текстаТекст → текст4 профессии

Дообученная BARTpho-syllable модель выявляет и исправляет орфографические ошибки в формальном вьетнамском тексте.

82скачиваний за 30 дней0лайковвеса обновлены4 сен 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Тесты пользователейпока нет

Никто ещё не опубликовал тест этой модели. Соберите бенчмарк из своих задач — результат появится здесь.

  1. Добавьте модель в бенчмарк

    Вместе с другими моделями категории «Текст» — сравнение идёт внутри одной категории.

  2. Опишите свои задачи

    Напишите запросы, при необходимости приложите файлы и эталонные ответы.

  3. Запустите и опубликуйте

    Модели ответят на каждую задачу, судья оценит ответы. Опубликованный результат появится на этой странице.

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

bravend/bartpho-syllable-vi-spellcheck — дообученная VinAI BARTpho-syllable модель для проверки и исправления орфографии во вьетнамском языке. Она использует архитектуру encoder-decoder на базе mBART и общий энкодер с двумя головами: одна генерирует исправленный текст, другая определяет ошибки на уровне токенов. В репозитории указаны 242,3 млн параметров, контекст до 1024 токенов, формат safetensors и библиотека Transformers.

Модель предназначена для проверки формального письменного вьетнамского в новостях, документах и отредактированной прозе. Её можно применять для автоматической коррекции предложений и предварительного выявления подозрительных слов; режим детекции работает без генерации и быстрее. Обучение включало синтетические орфографические ошибки и данные VSEC; модель оценивалась на этом бенчмарке.

Модель хуже справляется с неформальной речью и интернет-сленгом, редко отмечает имена собственные и может ошибочно помечать допустимые орфографические варианты. Она обучалась на отдельных предложениях, поэтому длинные тексты следует предварительно разделять на предложения; входы длиннее 1024 токенов также нужно делить. Для загрузки требуются классы из репозитория через trust_remote_code=True. Лицензия CC BY-NC 4.0 ограничивает коммерческое использование.

Сценарии применения

  • исправление опечаток во вьетнамских документах
  • проверка орфографии в новостных текстах
  • поиск ошибочных слов во вьетнамских предложениях
  • проверка отредактированной прозы перед публикацией

Ограничения

Слабее работает с неформальными сообщениями и teencode, редко выявляет ошибки в именах собственных и может отмечать допустимые варианты написания. Текст нужно подавать по предложениям, а для загрузки требуются пользовательские классы из репозитория.

Для каких профессий подходит4

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

Vietnamese Spell Checker — BARTpho-syllable multi-task (correction + detection)

Mô hình kiểm tra chính tả tiếng Việt: một encoder-decoder BARTpho-syllable với hai đầu ra dùng chung encoder — đầu sinh câu đã sửa (generation) và đầu phát hiện lỗi mức token (detection head). Đánh giá trên VSEC (9.341 câu).

A Vietnamese spelling-error detector/corrector. One BARTpho-syllable encoder-decoder with two heads sharing the encoder: a seq2seq correction head and a token-level error-detection head. Evaluated on the VSEC benchmark (9,341 sentences).

Results on VSEC (official protocol of the VSEC paper)

ModelDPDRDFDF0.5CPCRCFCF0.5
N-gram (VSEC paper, Table 4)0.9120.7310.812–0.8910.7140.793–
VSEC subword Transformer (VSEC paper)0.9310.8130.8680.9050.8740.7630.8150.849
VinAI spelling correction system (Nguyen et al., IUI 2023)0.9370.8680.9010.9230.9090.8430.8750.896
This model — generate, greedy0.9660.8550.9070.9420.9110.8060.8550.887
This model — generate, beam 40.9680.8580.9100.9440.9120.8090.8570.890
This model — detection head only, threshold 0.40.9350.8330.8810.913––––

Detection-head threshold sweep (encoder only, no decoding):

threshold0.30.40.50.60.70.9
DP0.9150.9350.9510.9620.9720.987
DR0.8470.8330.8170.7990.7800.697
DF0.8800.8810.8790.8730.8650.817

Quick start

import torch, difflib, unicodedata, re
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM

repo = "bravend/bartpho-syllable-vi-spellcheck"
tok = AutoTokenizer.from_pretrained(repo, trust_remote_code=True)
model = AutoModelForSeq2SeqLM.from_pretrained(repo, trust_remote_code=True).eval().cuda()

# --- input normalization (the model was trained on text normalized this way) ---
_TONE = {"òa":"oà","óa":"oá","ỏa":"oả","õa":"oã","ọa":"oạ","òe":"oè","óe":"oé","ỏe":"oẻ",
         "õe":"oẽ","ọe":"oẹ","ùy":"uỳ","úy":"uý","ủy":"uỷ","ũy":"uỹ","ụy":"uỵ"}
_TONE.update({k.capitalize(): v.capitalize() for k, v in list(_TONE.items())})
_TONE_RE = re.compile("|".join(map(re.escape, _TONE)))
def normalize(text):
    text = unicodedata.normalize("NFC", text.strip())
    text = text.translate(str.maketrans({"“":'"',"”":'"',"‘":"'","’":"'","–":"-","—":"-","…":"..."}))
    return _TONE_RE.sub(lambda m: _TONE[m.group()], text)

text = normalize("Tôi đi hoc ở Học viện Công nghệ Bưu Chính Viễn Thông, chuyên nghành công nghệ thông tin.")
enc = tok(text, return_tensors="pt", truncation=True, max_length=1024).to("cuda")

with torch.no_grad():
    # 1) correction
    out = model.generate(**enc, num_beams=1, max_length=1024)
    corrected = tok.decode(out[0], skip_special_tokens=True)
    # 2) token-level error probability from the detection head (encoder only)
    tok_probs = model.detect(enc.input_ids, enc.attention_mask)[0]   # (seq_len,)

print(corrected)   # Tôi đi học ở Học viện Công nghệ Bưu Chính Viễn Thông, chuyên ngành công nghệ thông tin.

Word-level flags with the recommended rule (generation ∪ detection ≥ 0.9)

def word_error_probs(words):
    """P(error) per word = max over the word's sub-word pieces (labels were assigned per word)."""
    ids, spans = [], []
    for w in words:
        p = tok(w, add_special_tokens=False)["input_ids"]
        spans.append((len(ids), len(ids) + len(p)))
        ids.extend(p)
    inp = torch.tensor([tok.build_inputs_with_special_tokens(ids)], device="cuda")
    probs = model.detect(inp)[0]
    off = 1                                  # one leading <s>
    return [probs[off+a:off+b].max().item() if b > a else 0.0 for a, b in spans]

def gen_changed(src_words, pred_words):
    flags = [False] * len(src_words)
    for tag, i1, i2, _, _ in difflib.SequenceMatcher(a=src_words, b=pred_words).get_opcodes():
        if tag in ("replace", "delete"):
            for k in range(i1, i2): flags[k] = True
        elif tag == "insert" and src_words:
            flags[min(i1, len(src_words) - 1)] = True
    return flags

src_words = text.split()
flags = [g or p >= 0.9 for g, p in zip(gen_changed(src_words, corrected.split()),
                                       word_error_probs(src_words))]
print([w for w, f in zip(src_words, flags) if f])   # ['hoc', 'nghành']

Notes:

  • trust_remote_code=True is required: the repo ships the multi-task class (modeling_spellcheck.py) and a tokenizer whose SentencePiece model is restricted to the 40K vocabulary (tokenization_spellcheck.py). Loading with the stock classes silently drops the detection head and tokenizes rare strings differently from training.
  • Inputs longer than 1024 sub-word pieces must be split (by sentence) before calling the model. The model was trained on single sentences; feed whole paragraphs sentence by sentence.
  • Detection-only mode (model.detect) is encoder-only and ~30× faster than generation; use it for triage, and generation for the final decision.
  • The detection threshold trades precision for recall: 0.4 gives the best DF; 0.7 gives DP ≈ 0.97 at DR ≈ 0.78 (see the sweep above).

Model description

Base modelvinai/bartpho-syllable (MBart, 12+12 layers, d=1024, ~400M params)
Extra parametersdetection head: Linear(1024,1024) → ReLU → Dropout → Linear(1024,2) on encoder outputs
Precisionfloat32
Max length1024 sub-word pieces
TokenizerBartphoTokenizer with SentencePiece restricted to the 40,030-entry vocabulary

Training

  • Stage 1 — multi-task training (generation loss + detection cross-entropy) on ~12M Vietnamese news sentences with synthetic errors: tone-mark and diacritic confusions, telex/VNI typing errors, keyboard typos, syllable split/merge, phonologically plausible real-word substitutions (word confusion cache filtered to valid syllables), classic compound confusions, and tone-mark misplacement. ~7–10% of samples are kept clean.
  • Stage 2 — a 50-step fine-tune mixing 18% self-mined hard negatives (word-level min P(error) ≤ 0.6) with fresh synthetic data, LR 8e-6, effective batch 552. Longer hard-negative training overfit the synthetic distribution and was rejected on held-out data.

Intended use and limitations

  • Intended for formal written Vietnamese (news, documents, edited prose).
  • Weak on informal social-media text and teencode: on the ViLexNorm test set this checkpoint reaches only F1 ≈ 0.73 for error detection.
  • Proper nouns are rarely flagged: the synthetic noise never corrupts mid-sentence TitleCase words, so the model learned that capitalized words are trustworthy.
  • Trained on single sentences: multi-paragraph inputs must be sentence-split first, otherwise headline lines and paragraph breaks trigger spurious rewrites.
  • Legitimate orthographic variants (i/y as in kì/kỳ, sĩ/sỹ) may be flagged; a small rule layer on top is advisable in production.

License

Released under CC BY-NC 4.0: free to use, share and adapt for non-commercial purposes with attribution. Any commercial or production use requires prior written permission from the author — please contact the author at bravend.dev@gmail.com or through this Hugging Face profile. The base model vinai/bartpho-syllable is MIT-licensed.

Citation

@misc{bravend2026vispellcheck,
  title  = {Vietnamese Spell Checker: BARTpho-syllable multi-task correction + detection},
  author = {Nguyen Duy Dung},
  year   = {2026},
  url    = {https://huggingface.co/bravend/bartpho-syllable-vi-spellcheck}
}

Base model:

@inproceedings{bartpho,
  title     = {{BARTpho: Pre-trained Sequence-to-Sequence Models for Vietnamese}},
  author    = {Nguyen Luong Tran and Duong Minh Le and Dat Quoc Nguyen},
  booktitle = {Proceedings of INTERSPEECH},
  year      = {2022}
}

Benchmark dataset:

@inproceedings{do2021vsec,
  title     = {{VSEC: Transformer-based Model for Vietnamese Spelling Correction}},
  author    = {Do, Dinh-Truong and Nguyen, Ha Thanh and Bui, Thang Ngoc and Vo, Hieu Dinh},
  booktitle = {PRICAI 2021: Trends in Artificial Intelligence},
  year      = {2021},
  doi       = {10.1007/978-3-030-89363-7_20}
}

Compared system:

@inproceedings{nguyen2023vietnamese,
  title     = {A Vietnamese Spelling Correction System},
  author    = {Nguyen, Thien Hai and Pham, Thinh and Le, Khoi Minh and Luong, Manh and Tran, Nguyen Luong and Man, Hieu and Nguyen, Dang Minh and Luu, Anh Tuan and Nguyen, Thien Huu and Bui, Hung and Phung, Dinh and Nguyen, Dat Quoc},
  booktitle = {Companion Proceedings of the 28th International Conference on Intelligent User Interfaces (IUI '23)},
  year      = {2023},
  doi       = {10.1145/3581754.3584159}
}

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · transformers

Можно запустить

Подбираем GPU…

Класс архитектуры
MBartMultiTaskForSpellCheck
Ревизия весов
31f323b

0 моделей