GUÍA de IA en audio

Alineación forzada

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.

Escuche esta guíaNarrado por IA · ~8 min

En esta pagina9 minutos de lectura
  1. Descripción general
  2. Conclusiones clave
  3. Buceo profundo
  4. Aligning a short interview clip with the Montreal Forced Aligner
  5. Implementación en el mundo real
  6. El futuro de la alineación forzada
  7. Poniéndolo en práctica
  8. Fuentes y lecturas adicionales
  9. Sigue explorando
  10. Preguntas frecuentes

Descripción general

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.

Conclusiones clave

  1. Forced alignment places a known transcript on audio and returns start and end times for each word or phone; it does not check that the transcript is right.
  2. Classic aligners such as the Montreal Forced Aligner use a pronunciation dictionary, HMM acoustic models and the Viterbi algorithm at 10 ms resolution.
  3. Neural aligners use CTC models such as wav2vec 2.0, which output one frame every 20 ms and need no pronunciation dictionary.
  4. In a 2024 Interspeech comparison, MFA placed 72.8% of TIMIT word boundaries within 25 ms, against 52.7% for WhisperX and 43.5% for MMS.
  5. Overlapping speech, disfluencies missing from the transcript, and unnormalized numbers or symbols are the most common causes of bad alignments.

Buceo profundo

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.

04Ejemplo resuelto

Aligning a short interview clip with the Montreal Forced Aligner

  1. 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.

  2. Write numbers and symbols out as words, for example twenty fourteen instead of 2014, so every token can be found in a pronunciation dictionary.

  3. Install MFA and download a pretrained acoustic model and a matching pronunciation dictionary for the language from the MFA model listings.

  4. 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.

  5. Run the aligner on the corpus folder to produce time-aligned word and phone tiers for each file.

  6. 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.

lo que muestra

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.

Implementación en el mundo real

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.

El futuro de la alineación forzada

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.

Poniéndolo en práctica

Por qué es importante

  • Acceso y alcance. Mejora la accesibilidad a través de transcripción, narración e interfaces de voz.
  • Costo y presupuesto. Los equipos de medios pueden enviar audio pulido más rápido con presupuestos más pequeños.
  • Velocidad y escala. Los sistemas de cara al cliente pueden procesar interacciones habladas a mayor escala.

cuidado con

  • Los riesgos de uso indebido de voz y suplantación de identidad aumentan cuando falta el consentimiento.
  • La precisión puede disminuir según los acentos, los dialectos o los entornos ruidosos.
  • El audio sintético puede confundirse con el habla auténtica sin un etiquetado claro.

Próximos pasos

  1. Obtenga consentimiento explícito para la captura, clonación y reutilización de voz.
  2. Pruebe la calidad en diversos oradores y condiciones de fondo.
  3. Defina cuándo un humano debe revisar o aprobar los resultados.
  4. Etiquete el audio sintético y mantenga registros de procedencia para la rendición de cuentas.

Fuentes y lecturas adicionales

  1. ISCA (Interspeech 2017)Montreal Forced Aligner: Trainable Text-Speech Alignment Using Kaldi
  2. Montreal Forced AlignerUser Guide, Montreal Forced Aligner documentation
  3. arXiv (Interspeech 2024)Tradition or Innovation: A Comparison of Modern ASR Methods for Forced Alignment
  4. PyTorch (torchaudio)CTC forced alignment API tutorial
  5. arXiv (Interspeech 2023)WhisperX: Time-Accurate Speech Transcription of Long-Form Audio
  6. GitHubm-bain/whisperX
  7. arXiv (Meta AI)Scaling Speech Technology to 1,000+ Languages

Sigue explorando

Boletín gratuito

Recibe el resumen diario de IA

Tres noticias verificadas sobre IA cada mañana de lunes a viernes, explicadas con claridad. Gratis para siempre y sin anuncios.

Un correo cada día laborable. Date de baja con un clic. Nunca vendemos ni compartimos tu dirección.

Ponte a prueba

Take the Forced Alignment quiz

Corrección inmediata en cada respuesta y un certificado para compartir, con un ID verificable, cuando apruebas un curso.

Empezar el cuestionario

Apoya la educación gratuita sobre IA. AI Understanding es una organización sin fines de lucro 501(c)(3): sin anuncios ni muros de pago, nunca. Hacer una donación

Preguntas frecuentes

¿Qué es la alineación forzada?

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.

Dado el audio y su transcripción, ¿qué resultado crea la alineación forzada?

An aligner estimates where units in the supplied transcript occur in the audio.

Why is alignment called “forced”?

The transcript is fixed input; the aligner searches for timing that fits it.

What does a pronunciation dictionary provide in a classic aligner?

MFA uses a pronunciation dictionary to map words to phones before alignment.

What search method does the classic Kaldi-based Montreal Forced Aligner use to find a likely sequence through speech?

The MFA paper describes its Kaldi-based acoustic-model alignment pipeline and Viterbi-style decoding.

In WhisperX, what helps handle long-form audio before word-level forced alignment?

WhisperX segments audio with voice-activity detection before transcription and phoneme alignment.