PTCSpell: Pre-trained Corrector Based on Character Shape and Pinyin for Chinese Spelling Correction

Xiao Wei, Jianbao Huang, Hang Yu, Qian Liu

Abstract

Chinese Spelling Correction (CSC) faces unique challenges due to the high prevalence of phonologically and visually similar character errors. We present PTCSpell, a novel pre-trained corrector that explicitly models character shapes and pronunciations. By integrating visual (SCSBERT) and phonetic (SPBERT) features into a multi-module architecture and employing a balanced loss strategy, PTCSpell achieves a significant 5.8% F1 improvement over state-of-the-art methods on standard SIGHAN benchmarks.

Introduction

Chinese Spelling Correction (CSC) is a critical task in natural language processing, yet it remains notoriously difficult because errors are rarely random. Instead, they are overwhelmingly driven by similarity: approximately 83% of errors are phonological (sounding the same) and 48% are visual (looking the same).

Current state-of-the-art models often rely on general-purpose language models like BERT. While BERT excels at contextual understanding, it treats Chinese characters as discrete tokens, ignoring the rich internal information of how a character is written or pronounced. Furthermore, most CSC systems use a "detector-corrector" pipeline. A common failure mode occurs when the detector incorrectly flags a correct character as an error; the corrector then changes that correct character, inadvertently introducing a new error (over-correction).

Methodology

PTCSpell operates within a detector-corrector framework, introducing three major innovations in the corrector module to leverage the physical reality of how Chinese is written and spoken.

The PTCSpell architecture featuring SCSBERT, SPBERT, and standard BERT fusion.

SCSBERT (Similar Character Shape BERT)

This module is pre-trained to capture visual features. The authors utilized the SIFT (Scale-Invariant Feature Transform) algorithm to calculate visual similarity between character images. During pre-training, characters in a corpus were replaced with visually similar ones, teaching the model to recognize "look-alike" errors.

SPBERT (Similar Pinyin BERT)

Focusing on phonetics, this module converts characters to Pinyin. During pre-training, tokens were randomly replaced with phonetically similar ones, allowing the model to learn "sound-alike" patterns.

Multi-Module Fusion and Balanced Loss

PTCSpell fuses the hidden states of SCSBERT, SPBERT, and a standard BERT (for semantic context) using concatenation. This allows the model to weigh visual, phonetic, and semantic evidence simultaneously. To address the "over-correction" problem, a balanced loss strategy was implemented. By including a small, controlled proportion ($\alpha$) of correct characters in the fine-tuning loss, the corrector learns to be skeptical of the detector's flags, preserving correct characters when contextually appropriate.

Experiments and Results

The model was trained on the SIGHAN (2013, 2014, 2015) training sets and the Wang271K pseudo-dataset. Evaluation was conducted on the standard SIGHAN benchmarks.

Performance comparison of PTCSpell against state-of-the-art methods on SIGHAN benchmarks.

PTCSpell established a new state-of-the-art for CSC performance. It achieved an average Correction Level F1 improvement of 5.8% over previous models like MDCSpell and REALISE. Notably, on the SIGHAN 2014 benchmark, the Correction F1 score reached 75.9%, a substantial jump from previous competitive baselines. Ablation studies confirmed that removing either the shape or pinyin modules led to performance degradation, proving that both visual and phonetic cues are essential.

Conclusion

PTCSpell demonstrates that grounding language models in visual and phonetic features significantly enhances Chinese Spelling Correction. While highly effective for substitution errors, future work is needed to address missing or redundant characters. Additionally, while the visual module is potentially adaptable to other logographic scripts, the phonetic module remains specific to the Chinese Pinyin system.

Summary updated

BibTeX
@inproceedings{wei2023ptcspell,
  author = {Xiao Wei and Jianbao Huang and Hang Yu and Qian Liu},
  title = {{PTCSpell: Pre-trained Corrector Based on Character Shape and Pinyin for Chinese Spelling Correction}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2023},
  doi = {10.18653/v1/2023.findings-acl.394},
}
Figure