How the model was trained
- Training data: the 900 clips of the competition file
train.csv.
- Input: the audio clip and the clean transcript. The clean transcript is the decoder prompt.
- Prompt format:
<|startofprev|> clean text <|startoftranscript|><|hi|><|transcribe|><|notimestamps|> verbatim text.
- Target: the verbatim transcript. The loss uses only the verbatim part.
- Settings: 6 epochs, learning rate 1e-5, batch size 4 with 2 accumulation steps, seed 42. The first 16 encoder layers are frozen.
- The weights are stored as float16.
The notebook train.ipynb contains the full training code. The notebook inference.ipynb contains the full inference pipeline.
How to load the model
import torchfrom transformers import WhisperForConditionalGeneration, WhisperProcessor repo = "21f1003882/Automatic-Disfluency-Restoration-NPPE2"processor = WhisperProcessor.from_pretrained(repo)model = WhisperForConditionalGeneration.from_pretrained(repo, torch_dtype=torch.float32).to("cuda").eval()
Give the clean transcript to the decoder as a prompt, as shown in the prompt format above.
Without the prompt, the model works as a usual Hindi speech recognition model that keeps fillers.
Files
model.safetensors: the fine-tuned weights.
config.json and generation_config.json: the model and generation configuration.
preprocessor_config.json: the audio feature extractor configuration.
tokenizer.json, tokenizer_config.json, vocab.json, merges.txt, normalizer.json, added_tokens.json, special_tokens_map.json: the tokenizer files.
Open-source parts only
The work uses only open-source parts: Whisper, PyTorch, transformers, librosa and pandas. It uses no paid or private API.