jssaluja/indicconformer-sggs-ncer-train-182765-epochs-21-test-2200
This model is a CTC fine-tune of the pretrained AI4Bharat IndicConformer Punjabi encoder (ai4bharat/indicconformer_stt_pa_hybrid_ctc_rnnt_large) with a new 512-piece Gurbani SentencePiece (BPE) vocabulary and CTC head, trained on private Punjabi Gurbani speech. It achieves the following results on the evaluation set (final model: average of epochs 17, 18, 19, 20, 21, greedy CTC):
- Wer: 0.2409
- Cer: 0.0718
- Ncer: 0.0431
- Ccer: 0.0814
- Kirtan rows only (631 rows): Wer 0.3480, Cer 0.1317, Ncer 0.1201
Model description
- Architecture: IndicConformer encoder (pretrained, fine-tuned end to end) + new 1x1 convolution head, 115,392,018 parameters (weights and buffers), CTC loss
- Output: 512 pieces + CTC blank, blank id 512 (the last id)
- train_scope:
verse_only - final model: average of the last 5 epochs
- train rows: 182765
- test rows: 2200
Intended uses & limitations
Punjabi Gurbani (Sri Guru Granth Sahib paath and kirtan) ASR. Output is raw acoustic text and should be matched to real Gurbani before it is shown to users.
Not a transformers checkpoint, so pipeline() will not load it.
Inference
For ready-to-run CPU inference use the int8 ONNX export: jssaluja/sggs-asr-indic-v0-onnx.
final/model.pt holds two state dicts, encoder and head, and final/gurbani_512.model is the matching SentencePiece model.
Rebuild the network from the base model, then load the weights:
pip install torch sentencepiece huggingface_hub soundfile
pip install "nemo_toolkit[asr] @ git+https://github.com/AI4Bharat/NeMo@8dce88cf8e94963e2033c3137f7b9993b51db88a"
import torch, sentencepiece as spm
from huggingface_hub import hf_hub_download
from nemo.collections.asr.models import ASRModel
repo = 'jssaluja/indicconformer-sggs-ncer-train-182765-epochs-21-test-2200'
state = torch.load(hf_hub_download(repo, 'final/model.pt'), map_location='cpu')
sp = spm.SentencePieceProcessor(model_file=hf_hub_download(repo, 'final/gurbani_512.model'))
base = ASRModel.restore_from(hf_hub_download('ai4bharat/indicconformer_stt_pa_hybrid_ctc_rnnt_large', 'indicconformer_stt_pa_hybrid_rnnt_large.nemo'), map_location='cpu')
base.encoder.load_state_dict(state['encoder'])
head = torch.nn.Conv1d(base.cfg.encoder.d_model, 512 + 1, 1)
head.load_state_dict(state['head'])
# 16 kHz mono wave -> base.preprocessor -> base.encoder -> head -> log_softmax
# ids = argmax per frame, collapse repeats, drop blank 512; text = sp.decode(ids)
Training and evaluation data
Train rows: 182765. Eval rows: 2200. Source collection names are not published.
Training procedure
Training hyperparameters
The following hyperparameters were used during training:
- phase 1 (encoder frozen, head only): 1 epoch, learning_rate: 0.001
- phase 2 (full model): 20 epochs, learning_rate: 5e-05 (encoder), 10x for the head
- warmup_steps: 1000, weight_decay: 0.01
- batches: padded audio up to 400.0 seconds per batch, duration-bucketed
- seed: 42
- optimizer: AdamW, linear warmup then decay
- augmentation: SpecAugment from the base model
- mixed_precision_training: bf16 autocast
- final weights: average of the last 5 epochs
Training results
(table generated directly from the epoch-end evaluation history, keyed by metric name. Phase 1 is the head-only epoch, phase 2 the full-model epochs. Training Loss is the CTC loss.)
| Training Loss | Epoch | Phase | Ccer | Cer | Ncer | Wer | Kirtan Wer | Kirtan Ncer |
|---|---|---|---|---|---|---|---|---|
| 7.6894 | 1.0 | 1 | 0.2162 | 0.1955 | 0.1498 | 0.5452 | 0.7026 | 0.3357 |
| 2.0125 | 2.0 | 2 | 0.1382 | 0.1232 | 0.0802 | 0.3936 | 0.5414 | 0.2030 |
| 1.4495 | 3.0 | 2 | 0.1173 | 0.1045 | 0.0651 | 0.3448 | 0.4937 | 0.1745 |
| 1.2892 | 4.0 | 2 | 0.1119 | 0.0996 | 0.0608 | 0.3298 | 0.4743 | 0.1627 |
| 1.1821 | 5.0 | 2 | 0.1055 | 0.0940 | 0.0557 | 0.3133 | 0.4522 | 0.1560 |
| 1.1047 | 6.0 | 2 | 0.1000 | 0.0884 | 0.0540 | 0.2932 | 0.4214 | 0.1431 |
| 1.0434 | 7.0 | 2 | 0.0972 | 0.0858 | 0.0518 | 0.2860 | 0.4027 | 0.1396 |
| 1.0000 | 8.0 | 2 | 0.0931 | 0.0825 | 0.0492 | 0.2751 | 0.4059 | 0.1359 |
| 0.9628 | 9.0 | 2 | 0.0916 | 0.0811 | 0.0495 | 0.2702 | 0.3982 | 0.1359 |
| 0.9376 | 10.0 | 2 | 0.0898 | 0.0795 | 0.0481 | 0.2653 | 0.3895 | 0.1357 |
| 0.9042 | 11.0 | 2 | 0.0899 | 0.0796 | 0.0476 | 0.2646 | 0.3836 | 0.1335 |
| 0.8720 | 12.0 | 2 | 0.0869 | 0.0769 | 0.0463 | 0.2579 | 0.3722 | 0.1268 |
| 0.8503 | 13.0 | 2 | 0.0852 | 0.0753 | 0.0450 | 0.2510 | 0.3635 | 0.1250 |
| 0.8334 | 14.0 | 2 | 0.0859 | 0.0759 | 0.0458 | 0.2542 | 0.3651 | 0.1257 |
| 0.8158 | 15.0 | 2 | 0.0846 | 0.0748 | 0.0456 | 0.2500 | 0.3633 | 0.1251 |
| 0.8086 | 16.0 | 2 | 0.0831 | 0.0734 | 0.0443 | 0.2457 | 0.3624 | 0.1268 |
| 0.7938 | 17.0 | 2 | 0.0822 | 0.0728 | 0.0437 | 0.2438 | 0.3537 | 0.1225 |
| 0.7889 | 18.0 | 2 | 0.0831 | 0.0734 | 0.0439 | 0.2454 | 0.3585 | 0.1238 |
| 0.7807 | 19.0 | 2 | 0.0816 | 0.0722 | 0.0431 | 0.2427 | 0.3519 | 0.1210 |
| 0.7786 | 20.0 | 2 | 0.0817 | 0.0721 | 0.0435 | 0.2416 | 0.3521 | 0.1216 |
| 0.7714 | 21.0 | 2 | 0.0818 | 0.0723 | 0.0432 | 0.2422 | 0.3471 | 0.1203 |
Framework versions
- Pytorch 2.4.1
- NeMo: AI4Bharat fork 8dce88cf8e