asr-punctuation-restore-bn

Bengali punctuation restoration weights: MuRIL (google/muril-base-cased) fine-tuned as a token classifier, at four depths (6/8/11/12 layers). Restores three marks on raw, unpunctuated Bengali text: (period), , (comma), ? (question).

This is ASR-agnostic — it takes text, not audio, so it works on the output of any speech recognizer (Whisper, whisper.cpp, faster-whisper, Google STT, Azure, ...), not just the model these weights were originally packaged with.

Provenance

These are the exact weights from the punct/ subfolders of SayedShaun/bengali-whisper-medium, republished standalone (layers at the repo root, not nested under punct/) so users of the asr-punct-restore package don't need to pull the (much larger) ASR repo just for the punctuation heads.

Original training: bs=64, lr=2e-4, max_seq_length=512, trained on normalized IndicCorp v2 Bangla.

Attribution

These weights are part of the 1st-place solution of the Bengali.AI Speech Recognition Kaggle competition, trained by Erdene-Ochir Tuguldur (tugstugi), team Chimege. This repository only republishes and repackages them — all credit for training belongs to the original author. If you use these weights, please cite:

@misc{tuguldur2023bengaliasr,
  author = {Tuguldur, Erdene-Ochir},
  title  = {1st place solution, Bengali.AI Speech Recognition},
  year   = {2023},
  howpublished = {\url{https://www.kaggle.com/competitions/bengaliai-speech/writeups/chimege-1st-place-solution}}
}

Files

path size params (approx)
6layers/ 745 MB smallest
8layers/ 799 MB
11layers/ 880 MB
12layers/ 908 MB largest

Each subfolder is a complete, independent MuRIL token-classification checkpoint (config.json, model.safetensors, tokenizer files) — usable alone or ensembled with the others.

Label recovery

The original configs shipped as LABEL_0..LABEL_3 with no recorded semantics. The mapping below was recovered empirically — strip marks from punctuated Bengali text, then see which class fires where each mark was — and is already applied in each <n>layers/config.json's id2label, so no recalibration step is needed to use these weights:

class label agreement
0 O (no mark) 93–98%
1 PERIOD 91.0%
2 COMMA , 90.7%
3 QUESTION ? 95.8%

Two corpora were used. 365k characters of Bengali Wikipedia pinned classes 0–2, but contained only two question marks, so class 3 never fired there. It was confirmed separately against 2080 real Bengali questions from Tatoeba, interleaved with statements into multi-sentence passages so the model sees natural context:

class   total   true mark at that position
    0    2747   none=93.3%  ।=3.2%   ?=2.5%  ,=1.0%
    1     230   ।=87.0%     ?=10.4%  ,=1.7%
    2      27   ।=44.4%     ,=40.7%  ?=7.4%
    3     215   ?=95.8%     ।=3.7%

Comma is the weakest of the three and fires rarely on short standalone sentences, where placement is genuinely ambiguous; the Wikipedia measurement above (90.7% over 665 instances of running prose) is the more representative one.

Which one to use

The original author's own evaluation (27k words of Bengali prose, measured against real punctuation) is the relevant number here:

heads token accuracy macro F1 (, ,)
12 0.9661 0.811
11 + 12 0.9655 0.808
6 + 12 0.9655 0.807
6 + 8 + 11 + 12 (full ensemble) 0.9650 0.805
8 + 11 + 12 0.9645 0.802
6 0.9629 0.795

The 12-layer model alone was the best of every combination tried — better than the full ensemble. 6layers/ is the smallest/fastest download, not the most accurate; use 12layers/ if accuracy matters more than size to you. (On one 28-second ASR test clip, 6-layer output happened to match the full ensemble — that's a single anecdote, not evidence against the table above, which was measured properly on 27k words.)

Usage

Via the asr-punct-restore package (recommended — handles windowing, ensembling, and downloading only the layers you ask for):

pip install git+https://github.com/sayedshaun/asr-punct-restore.git
from asr_punct_restore import PunctuationRestorer

# a bare repo id downloads (and caches) automatically; this repo is the default
restorer = PunctuationRestorer("SayedShaun/asr-punctuation-restore-bn", layers=(12,))
print(restorer("your raw unpunctuated bengali text from any asr"))

PunctuationRestorer.from_pretrained(...) also still works, as an explicit alias for "load from the Hub" — both spellings do the same thing.

Constraints

  • Bengali only — feeding other languages produces labels without erroring, just meaningless ones.
  • Restores only , ,, ? — not exclamation points or other marks.
  • Assumes space-separated words as input.

License

Apache-2.0, inherited from the source model.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support