How it is used
The given transcript is passed as Whisper's decoder prompt (prompt_ids), and the model writes the verbatim
transcript after <|startoftranscript|><|hi|><|transcribe|><|notimestamps|>. A word-alignment step then keeps
every given word (repairing words that the dataset's substring cleaning damaged, e.g. ै → है) and inserts only
the missing filler words (strategy all_cap2: at most 2 inserted fillers per gap and per clip). See the competition inference.ipynb for the full pipeline.
from transformers import WhisperForConditionalGeneration, WhisperProcessorimport librosa, torch repo = "22f3001271/nppe2-whisper-medium-disfluency"processor = WhisperProcessor.from_pretrained(repo)model = WhisperForConditionalGeneration.from_pretrained(repo).eval() audio, _ = librosa.load("clip.wav", sr=16000)feats = processor(audio, sampling_rate=16000, return_tensors="pt").input_featuresprompt = processor.get_prompt_ids("वो शायद कल आएगा", return_tensors="pt")out = model.generate(feats, prompt_ids=prompt, language="hi", task="transcribe")print(processor.batch_decode(out, skip_special_tokens=True)[0])
Training
- Data: 900 Hindi clips (≈10 s each) from the NPPE-2 competition, with verbatim transcripts.
- Prompts were corrupted the same way as the test inputs (one random filler type removed with substring
replacement), re-sampled every epoch.
- Full fine-tune, AdamW, lr 1e-5, linear warm-up 10 %, fp16, SpecAugment; 6 epochs on all 900 clips
(epoch count and insertion strategy chosen on a 90-clip validation split).
- Validation (mean per-clip WER, test-like prompts): 0.111 with the capped merge vs 0.202 for copying the given text (90 held-out clips); public leaderboard 0.168 vs 0.194.
Files
model.safetensors, config.json, generation_config.json, tokenizer files, preprocessor_config.json,
and training_info.json (hyper-parameters, chosen epoch/strategy, validation history).