SelanjutnyaPanduan berikutnya
Penyelarasan Monotonik Glow-TTS
AI Audio
PANDUAN Audio AI
Forced alignment takes a recording and a transcript that is already known and works out when each word, and often each speech sound, starts and ends.
Dengarkan panduan iniDiceritakan oleh AI · ~8 min
It underpins word-timed captions, phonetics research and speech dataset preparation, and in a 2024 comparison the HMM-based Montreal Forced Aligner still placed word boundaries more precisely than newer neural systems.
Forced alignment is the job of placing a known transcript onto a recording in time. The inputs are an audio file and the text of what was said. The output is a start and end time for each word, and often for each phone, the smallest unit of sound that tells words apart, such as the k sound at the start of cat. It is called forced because the system is not allowed to decide what was said: it must explain the audio using exactly the given words in the given order. That separates it from speech recognition, which has to guess the words. With the word sequence fixed, the search is much smaller, so an aligner can be precise about timing. It also means an aligner does not check the transcript. If the text is wrong, the wrong words still get placed somewhere.
The classic method uses a hidden Markov model (HMM), a statistical model that treats speech as a walk through a chain of hidden states. The Montreal Forced Aligner (MFA) documentation describes forced alignment as turning an orthographic transcript into a time-aligned version by using a pronunciation dictionary to look up the phones for each word. Step one is that lookup: each word becomes a phone sequence, and words missing from the dictionary can be handled by a grapheme-to-phoneme model that guesses pronunciations from spelling. Step two converts the audio into acoustic features. According to the 2024 Interspeech comparison by Rousso and colleagues, MFA uses 39 mel-frequency cepstral coefficient (MFCC) features, compact summaries of the spectrum's shape, computed every 10 ms over a 25 ms window.
Step three strings the phones of every word into one long left-to-right chain of HMM states, usually with optional silence between words. A Gaussian mixture model (GMM) scores how well each 10 ms frame of features matches each state. Step four runs the Viterbi algorithm, a dynamic programming search that finds the single most probable way to assign every frame to a state while moving through the chain in order. Wherever the best path crosses from one phone to the next is a phone boundary, and word boundaries follow from the phones. The resolution is therefore one frame, 10 ms.
MFA trains its acoustic models in passes, which the user guide lists as monophone models that ignore context, triphone models that consider the phone on each side, an LDA plus MLLT feature transform that makes phones easier to tell apart, and a final pass with per-speaker adaptation. Because training needs only transcripts, not hand-marked boundaries, MFA can be trained on the very data it is asked to align. The 2017 Interspeech paper by Michael McAuliffe, Michaela Socolof, Sarah Mihuc, Michael Wagner and Morgan Sonderegger introduced MFA as an update of the earlier Prosodylab-Aligner, moving from the HTK toolkit to Kaldi, adding triphones and speaker adaptation, and enabling parallel processing. It reported better boundaries than Prosodylab-Aligner and FAVE on English conversational and laboratory speech, and found that training on the target data generally helped. The documentation is now at version 3.4, which adds model formats that work with Hugging Face.
Neural aligners arrived with models trained using connectionist temporal classification (CTC), a training objective that lets a network learn to output characters from audio without being told where each character occurs. Wav2vec 2.0 models produce one output frame every 20 ms, per the Rousso paper. Meta's Massively Multilingual Speech (MMS) paper, posted in May 2023, built a single recognizer for 1,107 languages, and torchaudio packages an MMS model as MMS_FA for alignment. In March 2023 Max Bain, Jaesung Huh, Tengda Han and Andrew Zisserman posted WhisperX, accepted at Interspeech 2023, which adds voice activity detection and forced phoneme alignment to Whisper to get word timestamps, and reports a twelve-fold transcription speedup from batching pre-segmented audio.
The two families can be compared directly. Rousso, Cohen, Keshet and Chodroff scored MFA, WhisperX and MMS on TIMIT, read speech, and Buckeye, conversational speech, counting only words each neural system recognized correctly. Within 25 ms of the hand-labeled boundary, MFA placed 72.8% of TIMIT word boundaries, against 52.7% for WhisperX and 43.5% for MMS. On Buckeye the figures were 69.9%, 43.1% and 52.7%. At a looser 100 ms tolerance the TIMIT gap shrank to 97.4%, 94.2% and 94.7%. The authors suggest CTC training without aligned data and the coarser 20 ms frame rate as likely causes, though they did not test these directly. The practical trade-off is that neural pipelines need no pronunciation dictionary and can produce a transcript when none exists, while HMM aligners give tighter boundaries but need a lexicon and acoustic model for each language.
Failure modes are predictable. Transcripts that leave out filled pauses, false starts or repeated words force the aligner to stretch neighboring words over the extra sound. The WhisperX README says overlapping speech is not handled particularly well, and that tokens containing characters missing from the alignment dictionary, such as 2014. or a price in pounds, get no timing at all, so numbers and symbols should be written out as words first. The torchaudio tutorial warns that CTC models are peaky, meaning a character's probability spike may cover only one or two frames rather than its full duration, and that blank frames make word edges ambiguous. In the 2024 comparison, MFA and WhisperX were both less accurate on conversational Buckeye than on read TIMIT.
Requirements differ by tool. MFA is a command-line package built on Kaldi that needs a pronunciation dictionary and acoustic model for the language, either downloaded or trained on your own corpus. WhisperX targets GPUs; its README claims about 70 times real-time speed with the large-v2 model and under 8 GB of GPU memory with a beam size of 5. The torchaudio alignment APIs were deprecated in version 2.8 and removed in 2.9, so code based on the tutorial needs a pinned version or a replacement. In every case the honest check is to compare a sample of output boundaries with hand-marked ones before trusting the timings.
04Contoh yang berhasil
Collect a few WAV files of one or more speakers and write an exact plain-text transcript for each, including repeated words and filled pauses you can hear.
Write numbers and symbols out as words, for example twenty fourteen instead of 2014, so every token can be found in a pronunciation dictionary.
Install MFA and download a pretrained acoustic model and a matching pronunciation dictionary for the language from the MFA model listings.
Run MFA's validation step to list words missing from the dictionary, then add pronunciations for them or generate them with a grapheme-to-phoneme model.
Run the aligner on the corpus folder to produce time-aligned word and phone tiers for each file.
Open a sample of outputs next to the audio, mark ten word boundaries by hand, and measure how far each predicted boundary is from your mark.
Apa yang ditunjukkannya
A word and phone timing file for every recording, plus a small accuracy check. If most of your hand-checked boundaries fall within about 25 ms, the alignment is in the range the 2024 benchmark reports for MFA; large errors usually trace back to transcript mismatches.
Adding word-level timestamps to Whisper transcripts with WhisperX, which runs a separate wav2vec2 alignment model after transcription because, per its README, Whisper's own timestamps are utterance-level and can be off by several seconds.
Producing word and phone boundary tiers for phonetics research with the Montreal Forced Aligner, which looks up each word in a pronunciation dictionary and offers downloadable acoustic models for many languages.
Aligning speech in many languages with torchaudio's MMS_FA pipeline, a wav2vec 2.0 model from Meta's Massively Multilingual Speech project that emits character probabilities used for CTC forced alignment.
Handling a transcript that is missing its first words by adding the star token described in the torchaudio CTC tutorial, which absorbs untranscribed audio so the remaining words still align.
Benchmarking an aligner against hand-labeled boundaries in TIMIT, a read-speech corpus, and Buckeye, a conversational corpus, the two datasets used in the 2024 Interspeech comparison of MFA, WhisperX and MMS.
The main open problem is closing the precision gap between neural and HMM aligners. The 2024 Interspeech comparison by Rousso and colleagues found MFA best at every tolerance on both TIMIT and Buckeye, and named CTC's lack of alignment supervision and its 20 ms frame rate as probable causes, which points research toward neural models trained or fine-tuned with explicit boundary information and finer time resolution. A second direction is coverage. Meta's 2023 MMS work extended recognition to 1,107 languages, and alignment quality for low-resource languages, where no pronunciation dictionary or hand-labeled test set exists, remains hard to measure. Conversational audio is a third gap: overlapping talkers, disfluencies and transcripts that do not match the audio word for word still break most pipelines, which is why tools add wildcard tokens and voice activity detection. Tooling is also shifting, since torchaudio moved into maintenance mode and removed its alignment APIs in version 2.9, so users depend on where those functions are maintained next. Whether neural aligners will match HMM boundary accuracy on conversational speech is an open question rather than a settled trend.
Buletin gratis
Tiga cerita AI terverifikasi setiap pagi hari kerja, ditulis dalam bahasa Inggris sederhana. Gratis selamanya, tanpa iklan.
Satu email setiap hari kerja. Berhenti berlangganan dalam satu klik. Kami tidak pernah menjual atau membagikan alamat Anda.
Uji diri Anda sendiri
Umpan balik instan untuk setiap jawaban, dan sertifikat yang dapat dibagikan dengan ID yang dapat diverifikasi setelah Anda lulus kursus.
Mendukung pendidikan AI gratis. AI Understanding adalah organisasi nirlaba 501(c)(3) — tanpa iklan, tanpa paywall, selamanya. Berikan sumbangan
Forced alignment takes a recording and a transcript that is already known and works out when each word, and often each speech sound, starts and ends. It underpins word-timed captions, phonetics research and speech dataset preparation, and in a 2024 comparison the HMM-based Montreal Forced Aligner still placed word boundaries more precisely than newer neural systems.
An aligner estimates where units in the supplied transcript occur in the audio.
The transcript is fixed input; the aligner searches for timing that fits it.
MFA uses a pronunciation dictionary to map words to phones before alignment.
The MFA paper describes its Kaldi-based acoustic-model alignment pipeline and Viterbi-style decoding.
WhisperX segments audio with voice-activity detection before transcription and phoneme alignment.
Teruslah belajar
Panduan lainnya dipilih untuk topik ini
SelanjutnyaPanduan berikutnya
Penyelarasan Monotonik Glow-TTS
AI Audio