An End-to-End Chinese Text Normalization Model Based on Rule-Guided Flat-Lattice Transformer

Wenlin Dai, Changhe Song, Xiang Li, Zhiyong Wu, Huashan Pan, Xiulin Li, Helen Meng

Abstract

Text Normalization (TN) is a critical component of Text-to-Speech (TTS) systems, particularly for languages like Chinese where ambiguity and lack of word boundaries pose significant challenges. This paper introduces FlatTN, an end-to-end model that integrates rule-based expert knowledge with the contextual capabilities of a Flat-Lattice Transformer. By treating rules as structural hints rather than rigid constraints, FlatTN achieves state-of-the-art performance, reaching 99.1% accuracy on non-standard word classification.

Introduction

Text Normalization is the process of converting non-standard words (NSWs)—such as "2021," "3.4," or "172.0.0.1"—into their spoken forms. In Chinese, this task is exceptionally difficult due to semantic ambiguity and the lack of explicit word segmentation. For example, the number "2021" followed by "年" (year) is a date, but followed by "光年" (light-years), it is a cardinal number.

Traditional systems are typically either rule-based, which are reliable but brittle, or purely neural, which are context-aware but prone to uninterpretable errors. FlatTN bridges this gap by using a "Flat-Lattice" architecture that allows neural models to learn directly from expert-defined rules.

Methodology

FlatTN is built upon the Flat-Lattice Transformer (FLAT). The process begins with Rule-Guided Lattice Construction, where a lexicon and regular expressions identify all potential words and NSW candidates in a sentence, creating a graph of overlapping possibilities.

To maintain compatibility with Transformer architectures, this lattice is "flattened" into a sequence of spans. Each span is assigned specific "head" and "tail" indices to preserve its original position. Because standard positional encoding cannot handle overlapping spans, the model employs a sophisticated Relative Position Encoding that calculates distances between every pair of tokens (head-to-head, head-to-tail, etc.). Finally, the model utilizes a pre-trained BERT for embeddings and a Conditional Random Field (CRF) layer to ensure the predicted BMESO labels are mathematically consistent.

The FlatTN architecture integrates BERT embeddings with rule-guided lattice construction and a CRF output layer.

Dataset and Taxonomy

The authors released a first-of-its-kind large-scale Chinese TN dataset to provide a standardized benchmark for the field. Extracted from 30,000 Chinese Wikipedia sentences, the dataset includes a taxonomy of 29 distinct NSW categories, such as CARDINAL, DIGIT, and DATE_CARDINAL. This dataset addresses the historical reliance on private, proprietary data in TN research.

Experimental Results

FlatTN was evaluated against a commercial rule-based system and standard neural baselines, including BERT-MLP and BERT-LSTM. The results demonstrate that FlatTN significantly outperforms these methods in both accuracy and F1-score.

Performance comparison showing FlatTN achieving superior accuracy and F1-score over rule-based and standard neural methods.

Beyond overall metrics, the model achieved near-perfect scores on common categories like PUNC (99.6% F1) and MINUTE_CARDINAL (98.5% F1). Ablation studies confirmed that both the lexicon and rule-based spans are essential; removing either component led to a significant drop in performance.

Discussion and Conclusion

The primary innovation of FlatTN is treating rules as features rather than rigid filters. By including rule-matched spans in the lattice, the model "sees" expert suggestions and uses context to decide their validity. This approach effectively bypasses the traditional word segmentation bottleneck, as the model learns to disambiguate boundaries and categories simultaneously.

While the model excels in common categories, performance remains lower for rare NSW types like HYPHEN_RANGE (0.8599 F1). Future work will focus on refining the taxonomy and optimizing the computational complexity inherent in lattice-based Transformers to handle the "long-tail" of NSW cases more effectively.

Summary updated

BibTeX
@inproceedings{dai2022end,
  author = {Wenlin Dai and Changhe Song and Xiang Li and Zhiyong Wu and Huashan Pan and Xiulin Li and Helen Meng},
  title = {{An End-to-End Chinese Text Normalization Model Based on Rule-Guided Flat-Lattice Transformer}},
  booktitle = {IEEE International Conference on Acoustics, Speech and Signal Processing},
  year = {2022},
  doi = {10.1109/icassp43922.2022.9747316},
}
Figure