/ Модель

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

Лицензия
Своя лицензия
Библиотека
kenlm
Опубликована
19 окт 2026

malagasy-kenlm-4gram-v2

Распознавание речиАудио → текст3 профессии

4-граммная языковая модель малгашского языка для улучшения CTC-декодирования речи через pyctcdecode.

21скачиваний за 30 дней0лайковвеса обновлены19 окт 2026

Бенчмарки

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

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

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

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

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

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

Flo976 разработала словный 4-граммный языковой модел KenLM для декодирования результатов распознавания малгашской речи. Модель обучена на 134 млн слов и предназначена для beam-search декодирования CTC-выходов акустической модели Flo976/w2v-bert-malagasy с помощью pyctcdecode. В репозитории есть бинарная модель KenLM и список словоформ для декодера.

В тестировании на записях с говорящими, не встречавшимися при обучении, модель снизила частоту ошибок слов относительно предыдущей версии языковой модели. Декодер загружается примерно за 12 секунд и рассчитан на повторное использование после загрузки. Лицензия смешанная: источники обучающих текстов включают CC0, условия Common Crawl и CC-BY-SA-3.0; карточка указывает лицензию other.

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

  • улучшение beam-search декодирования малгашской речи
  • постобработка CTC-выходов модели Flo976/w2v-bert-malagasy
  • снижение ошибок распознавания коротких малгашских высказываний
  • декодирование длинных малгашских аудиозаписей

Ограничения

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

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

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

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

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

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

Открыть на Hugging Face

Malagasy KenLM 4-gram, v2 — 134 M words, for CTC speech recognition

A word-level 4-gram language model of Malagasy, trained on 134 million words, for beam-search decoding of Flo976/w2v-bert-malagasy with pyctcdecode. It succeeds Flo976/malagasy-kenlm-4gram (17 M words) and removes about one error in twenty-five that the previous one let through.

Résumé en français. Modèle de langue malgache (4-gramme KenLM, 134 millions de mots) pour le décodage du modèle de reconnaissance vocale. Avec lui, la chaîne fait 12,7 % d'erreurs de mots sur les énoncés courts et 10,1 % sur les extraits longs, contre 13,2 % et 10,4 % avec le modèle de langue précédent. Licence mixte : voir plus bas.

Results

Test split of badrex/malagasy-speech-full, speakers never seen in training. Same acoustic log-probabilities for every row, beam 100, apostrophe re-gluing after decoding, WER after the common normalization (lowercase, punctuation removed). Settings tuned on validation only; the test was measured once.

Language modelShort utterances 2–8 s (11,625)Full clips (3,101)
none (greedy)14.33 %12.01 %
previous 4-gram, 17 M words13.20 %10.41 %
previous 4-gram, re-tuned on validation12.92 %10.46 %
this model12.68 %10.13 %

Paired bootstrap (2,000 resamples), this model against the previous one with its published settings: −0.52 point [−0.65, −0.40] on short utterances and −0.29 [−0.39, −0.18] on full clips. Against the previous one re-tuned, which isolates the effect of the extra text: −0.24 [−0.35, −0.12] and −0.33 [−0.44, −0.23]. All remain significant with a stricter bootstrap that resamples whole speakers.

Usage

import json, re
import numpy as np
from huggingface_hub import snapshot_download
from pyctcdecode import build_ctcdecoder

lm = snapshot_download("Flo976/malagasy-kenlm-4gram-v2")
params = json.load(open(f"{lm}/params.json"))
unigrams = [w.strip() for w in open(f"{lm}/unigrams.txt", encoding="utf-8") if w.strip()]

tok = processor.tokenizer  # from Flo976/w2v-bert-malagasy
vocab = tok.get_vocab()
labels = ["" if t == tok.pad_token else " " if t == tok.word_delimiter_token else "⁇" if t == tok.unk_token else t
          for t in sorted(vocab, key=vocab.get)]

def decoder_for(seconds):
    p = params["short" if seconds <= 10 else "long"]
    return build_ctcdecoder(labels, kenlm_model_path=f"{lm}/{params['lm']}", unigrams=unigrams,
                            alpha=p["alpha"], beta=p["beta"])

# log-softmax, not raw logits: pyctcdecode expects log-probabilities
logp = logits - logits.max(-1, keepdims=True)
logp -= np.log(np.exp(logp).sum(-1, keepdims=True))
text = decoder_for(seconds).decode(logp, beam_width=100)
text = re.sub(r"'\s+", "'", re.sub(r"\s+'", "'", text))  # "amin' ny" -> "amin'ny"

Build each decoder once and reuse it: loading takes about 12 s.

Settingαβbeam
utterances of 10 s or less0.60.5100
longer clips0.50.5100

Decoding time is unchanged from the previous model (about 3.6 ms for a 5 s utterance on one CPU core). The binary takes 421 MB on disk and about 0.55 GB more RAM than the previous one.

Files

FileContent
mg_ext_4gram.binKenLM binary, trie, 8-bit quantized
unigrams.txt1,083,929 word forms seen at least twice, needed by pyctcdecode with a binary model
params.jsondecoding settings and build recipe
LICENSE_NOTES.mdsources and their licenses

Training text

Every source was normalized exactly like the ASR output and deduplicated. Every line sharing an 8-word sequence with any validation or test transcript was removed, from every source, train transcripts included.

SourceWordsLicense
HPLT v2 cleaned, Malagasy89.5 MCC0 for the dataset; web text
CC-100, Malagasy19.3 MCommon Crawl terms of use; web text
Malagasy Wikipedia16.4 MCC-BY-SA-3.0
Lo-Renz-O/malagasy-sentence8.2 MMIT
train-split transcripts of badrex/malagasy-speech-full0.9 Mnot declared

Build: lmplz -o 4 --prune 0 0 1 1 --discount_fallback, then build_binary -q 8 -b 7 -a 256 trie. A Bible translation was available but deliberately excluded for license reasons.

Limitations

  • Web text (HPLT, CC-100) brings noise, boilerplate and some other languages.
  • Settings were tuned with this acoustic model; another acoustic model needs its own α and β.
  • The text is mostly formal written Malagasy. Conversational phrases and commands are under-represented.

License

Mixed sources, no single open license. The model inherits the share-alike terms of Wikipedia (CC-BY-SA). Two thirds of its text is web text gathered by HPLT and CC-100: those datasets are distributed under CC0 or Common Crawl terms, but the pages themselves keep their authors' rights. An n-gram model does not contain the text in readable form, but it does contain sequences of up to four words. See LICENSE_NOTES.md. If you need a model with a clean CC-BY-SA licence, use Flo976/malagasy-kenlm-4gram.

Made for Milo Voice by Flo976 — Florent Didelot / Sooatek.

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

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

GPU в ailist

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

Нельзя запустить

В репозитории нет config.json: не понять архитектуру модели.

Ревизия весов
a85f3a3

0 моделей