
wav2vec2 (CTC ASR)
Audio and speech332 ops94.4M params
The wav2vec2 CTC aligner WhisperX uses to give Whisper transcripts word-level timestamps.
Audio and speech · 332 operations Checked
Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
How this diagram was made
transformers.AutoModelForCTC.from_config()
The model captured here is the alignment stage of WhisperX rather than Whisper itself: a wav2vec2 speech encoder with a CTC head that WhisperX runs over each audio segment to give accurate word-level timestamps using wav2vec2 alignment. WhisperX as a whole is a time-accurate speech recognition system with word-level timestamps utilising voice activity detection and forced phoneme alignment. The problem it fixes is that Whisper's timestamps are at the utterance-level, not per word, and can be inaccurate by several seconds.
The aligner is a phoneme recognition model, trained to classify the smallest unit of speech distinguishing one word from another, such as the element p in "tap". For each segment WhisperX restricts classification to the phoneme classes that appear in the segment text, then applies Dynamic Time Warping on the resulting logits matrix to obtain the optimal temporal path of phonemes. Each word's start and end time come from the start and end time of the first and last phoneme within the word. Transcript words which do not contain characters in the alignment model's dictionary cannot be aligned and therefore are not given a timing.
The member traced here is the English default: wav2vec2-base-960h, the base model pretrained and fine-tuned on 960 hours of Librispeech on 16kHz sampled speech audio. The paper's comparison of alignment models found that the base model trained on LibriSpeech performs consistently well and should be the default alignment model for WhisperX. The alignment model is language-specific, with default models provided for en, fr, de, es and it via torchaudio pipelines and many other languages via Hugging Face. The WhisperX paper was accepted to INTERSPEECH 2023.
Key idea. WhisperX reaches word-level timestamps by forced aligning each Whisper transcript segment against a phoneme recognition model's logits with Dynamic Time Warping, with a LibriSpeech wav2vec2 base model as the default aligner.
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
@misc{bain2023whisperxtimeaccuratespeechtranscription,
title={WhisperX: Time-Accurate Speech Transcription of Long-Form Audio},
author={Max Bain and Jaesung Huh and Tengda Han and Andrew Zisserman},
year={2023},
eprint={2303.00747},
archivePrefix={arXiv},
primaryClass={cs.SD},
url={https://arxiv.org/abs/2303.00747},
}