Bangla punctuation (MuRIL, 6 layers, Bengali vocab)
This is a compact Bengali punctuation-restoration model. It adds । (danda), , and ? to unpunctuated Bengali text, such as speech-recognition output. It's what Kothon uses on device after transcribing.
It's the 6-layer MuRIL token classifier from SayedShaun/asr-punctuation-restore-bn, which republishes the punctuation heads from Erdene-Ochir Tuguldur's first-place Bengali.AI Speech Recognition solution. Two changes were made:
- Vocabulary pruned from 197,285 to 26,789 tokens, keeping Bengali-script pieces, digits and single characters. MuRIL covers 17 Indian languages, and most of its size was the embedding table.
- Stored as F16. It's 122 MB instead of 745 MB.
On 13,954 words of FLEURS Bengali text, 14 labels changed (0.1%), with the same scores as the original.
Labels
| id | label | mark |
|---|---|---|
| 0 | O | none |
| 1 | PERIOD | । |
| 2 | COMMA | , |
| 3 | QUESTION | ? |
Each word takes the label of its first sub-token, and the mark goes after the word.
Accuracy and speed
Measured on FLEURS bn test references with their punctuation stripped, plus 30 hand-written questions.
| Set | Danda F1 | Comma F1 | Question F1 |
|---|---|---|---|
| Single sentences | 0.91 | 0.52 | n/a |
| 3-sentence passages | 0.88 (mid-text 0.84) | 0.53 | n/a |
| Questions mixed with statements | 0.92 | n/a | 0.81 |
In Kothon (Rust, candle with Apple Accelerate), it takes about 16 ms per dictated sentence on an M2 Max CPU.
Usage (Python)
from transformers import AutoTokenizer, AutoModelForTokenClassification
tok = AutoTokenizer.from_pretrained("omnixima/bangla-punctuation-muril6")
model = AutoModelForTokenClassification.from_pretrained("omnixima/bangla-punctuation-muril6")
words = "আজ আবহাওয়া খুব সুন্দর তুমি কি আজ অফিসে যাবে".split()
enc = tok(words, is_split_into_words=True, return_tensors="pt")
pred = model(**enc).logits.argmax(-1)[0].tolist()
License and credit
The license is Apache-2.0. The base model is google/muril-base-cased (Apache-2.0). The punctuation fine-tune was trained by Erdene-Ochir Tuguldur (tugstugi, team Chimege) on IndicCorp v2 Bangla, and was packaged and label-mapped by SayedShaun. This repository only prunes the vocabulary and changes the precision.
- Downloads last month
- 190
Model tree for omnixima/bangla-punctuation-muril6
Base model
SayedShaun/asr-punctuation-restore-bn