Automatic Spelling Correction with Transformer for CTC-based End-to-End Speech Recognition

Shiliang Zhang, Ming Lei, Zhijie YanarXiv 2019

Abstract

This paper introduces a Transformer-based spelling correction model, termed the "speller," to automatically rectify errors—particularly homophone substitutions—in CTC-based end-to-end Mandarin speech recognition systems. By treating error correction as a machine translation task and augmenting training data with N-best decoding lists, the proposed system achieves up to a 53.2% relative improvement in Character Error Rate (CER). This approach allows high-speed greedy-search decoding to surpass the performance of traditional, computationally intensive language-model-heavy decoding methods.

Introduction

Connectionist Temporal Classification (CTC) is a widely adopted framework for end-to-end Automatic Speech Recognition (ASR). However, a fundamental limitation of CTC is its assumption that output labels are conditionally independent, effectively making it an acoustic-only model.

For tonal languages like Mandarin, this independence assumption is problematic due to the prevalence of homophones—different characters with identical pronunciations. Without linguistic context, CTC models frequently substitute correct characters with phonetically identical but semantically incorrect ones. While traditional systems address this using external n-gram Language Models (LM) and complex Weighted Finite-State Transducer (WFST) searches, this paper explores whether a neural "speller" can efficiently correct these errors following a fast greedy-search decoding process.

System Architecture

The authors propose a modular pipeline comprising three primary components: the Listener, the Decoder, and the Speller.

The proposed three-component pipeline consisting of a Listener, Decoder, and Speller.
  • Listener (Acoustic Model): A Deep Feedforward Sequential Memory Network (DFSMN-CTC-sMBR) is employed to model long-term dependencies without recurrent feedback, utilizing hybrid character-syllable modeling units.
  • Decoder: This component generates text from acoustic features. The study compares standard WFST search (incorporating an external LM) against a simple, high-speed greedy search.
  • Speller: The core innovation is a standard encoder-decoder Transformer trained to "translate" the error-prone text from the Decoder into the correct ground-truth transcription.

Enhancing the Speller with N-best Data Expansion

A critical challenge in training the Speller is ensuring it encounters a realistic distribution of acoustic errors. Training solely on the single best output (1-best) of the Decoder provides insufficient diversity. To address this, the authors utilize N-best data expansion, extracting the top-N paths from the decoding lattice or using a threshold-based method for greedy search. This exposes the Transformer to a wider variety of phonetic ambiguities, significantly improving its robustness.

Interestingly, the authors found that synthetic error generation—randomly injecting errors into text-only corpora—was ineffective. The Speller requires errors that accurately reflect the specific phonetic mistakes made by the acoustic model to learn effective correction strategies.

Key Results and Insights

The Transformer-based speller demonstrated substantial performance gains across various configurations. A baseline CTC model using greedy search achieved a 7.28% CER, which improved to 4.42% when using traditional WFST + LM decoding. However, the combination of Greedy Search + Speller (with N-best expansion) reached a 4.21% CER, outperforming the traditional baseline while maintaining higher decoding speeds.

Examples of homophone error correction in Mandarin text.

As shown in the examples above, the Speller excels at resolving contextual ambiguities. For instance, it correctly identifies the term "track" (轨) in a technical context where the acoustic model initially predicted "ghost" (鬼), a common homophone error. Similarly, it corrects errors in specialized vocabulary like "ritual archery" and biochemical terms.

The best overall performance was achieved by applying the Speller to WFST output, reaching a 3.41% CER. This represents a 22.9% relative improvement over the WFST baseline and a 53.2% relative improvement over the greedy baseline.

Conclusion

This research demonstrates that treating ASR post-processing as a sequence-to-sequence translation task is highly effective for Mandarin speech recognition. The Transformer's self-attention mechanism successfully captures the linguistic context necessary to resolve homophone errors. Future work will focus on developing more realistic methods for simulating acoustic errors in text-only datasets, potentially allowing the model to leverage massive unlabeled corpora to further enhance its correction capabilities.

Summary updated

BibTeX
@misc{zhang2019automatic,
  author = {Shiliang Zhang and Ming Lei and Zhijie Yan},
  title = {{Automatic Spelling Correction with Transformer for CTC-based End-to-End Speech Recognition}},
  year = {2019},
  eprint = {1904.10045},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1904.10045},
}
Figure