Bi- DCS pell: A Bi-directional Detector-Corrector Interactive Framework for C hinese Spelling Check (2024)

Abstract: Chinese Spelling Check (CSC) aims to detect and correct potentially misspelled characters in Chinese sentences. Naturally, it involves the detection and correction subtasks, which interact with each other dynamically. Such interactions are bi-directional, i.e., the detection result would help reduce the risk of over-correction and under-correction while the knowledge learnt from correction would help prevent false detection. Current CSC approaches are of two types: correction-only or single-directional detection-to-correction interactive frameworks. Nonetheless, they overlook the bi-directional interactions between detection and correction. This paper aims to fill the gap by proposing a Bi-directional Detector-Corrector framework for CSC (Bi-DCSpell). Notably, Bi-DCSpell contains separate detection and correction encoders, followed by a novel interactive learning module facilitating bi-directional feature interactions between detection and correction to improve each other’s representation learning. Extensive experimental results demonstrate a robust correction performance of Bi-DCSpell on widely used benchmarking datasets while possessing a satisfactory detection ability.

## introduction chinese spelling check (csc) aims to automatically detect and correct spelling errors in chinese sentences @xcite @xcite . it serves as a foundation for a wide range of downstream applications in information retrieval (ir) and natural language processing (nlp), including search query correction, optical character recognition (ocr), and essay scoring. in recent years, csc has garnered increasing attention from both academia and industry, emerging as a crucial task in the realm of artificial intelligence @xcite . most existing approaches to csc can be categorized into two types of framework: (a) correctiononly (c-only) and (b) detection-to-correction (d2c). the c-only does not contain a detection module. instead, it directly adopts a specially designed corrector to perform the correction task @xcite @xcite @xcite . the most recent c-only models are inspired by masked language model (mlm) @xcite , where each character to be corrected is predicted using contextual information. the second type of framework possesses both detection and correction modules but the interaction between them is singledirectional in a way akin to a pipeline @xcite @xcite . that is, the detector first identifies the positions of errors, which are then used as prior knowledge for the correction module. while these two types of framework have been the dominant paradigms in the current csc literature, they neglect the bidirectional interactions between detector and corrector. this oversight leads to issues such as the substitution of correct characters with incorrect ones (over-correction) or the failure to correct mis-spelled characters @xcite . figure 1 presents an example to illustrate the differences among c-only, d2c, and bi-directional interactions. the input "你的球机真厉害，我 甘败下风。" contains two misspelled characters "机(jī, machine)" and "败(bài, fail)", which should be corrected as "技(jì, skill)" and "拜(bài, worship)", respectively. figure 1 (a) illustrates the conly approaches that are typically underpinned by an mlm. note that mlm tends to rectify a correct low-frequency collocation into a high-frequency one @xcite . in this example, as "败(bài, fail)" is more frequent in natural language than "拜(bài, worship)", it is difficult for a c-only approach to correct "败(bài, fail)" properly in case there is no prior error information from detection. in figure 1(b) , the d2c interaction first uses an error detector that determines "败(bài, fail)" is wrong. the result is then fed into the correction module, which then successfully corrects "败(bài, fail)" as "拜(bài, worship)". however, the corrector still may not be able to correct the other misspelled character "机(jī, machine)" as it is not pre-detected by the detector. this reflects that one-directional interaction (from detection to correction) can still lead to under-correction or over-correction. to fill this gap, we propose a novel bidirectional detector-corrector interactive framework for spelling check (bi-dcspell). the detection and correction subtasks dynamically interact with each other, implying that knowledge acquired from one can be transferred to enhance the representation learning of the other. this bi-directional exchange of knowledge facilitates mutual improvement in performance. a concrete case is depicted in figure 1(c ). different from the c-only and d2c approaches, bi-dcspell not only uses the detection result ("败(bài, fail)" is wrong), for the corrector to revise "败(bài, fail)" as "拜(bài, worship)", but also feeds the correction result back to the detector as contextual information to help identify that "机(jī, machine)" may also be wrong. specifically, our approach uses two independent encoders: one dedicated to detection and the other to correction, to capture the subtask-specific features from the input sequence. subsequently, we introduce an interactive learning module, which comprises a series of bi-directional cross-attention layers to enable the dynamic interactions between the two subtasks. finally, two task-specific classifiers are used to output the detection labels and generate the correction sequence. the performance of our method is evaluated on three widely used csc benchmark datasets: sighan13, sighan14, and sighan15. the results show that bi-dcspell surpasses interaction-free and uni-directional interactive baselines by 3.0% and 1.8% respectively in correction f1 score. moreover, our method compares favorably against the current state-of-the-art approaches on all three datasets. a further ablation study demonstrates the effect of incorporating the bi-directional interactions in csc. we also present a case study with concrete examples to illustrate the advantages of our model. the source code can be accessed at https://github.com/haiming-wu/ bi-spell . ## evaluation metrics the general evaluation metrics could be divided into sentence-level and character-level metrics. specifically, a prediction at the sentence-level is only deemed correct if all of the misspelled characters in the sentence have been detected or corrected. compared with character-level evaluation, sentence-level evaluation is more strict and tends to yield lower scores. following the common practice in the literature @xcite , we adopt the commonly used sentence-level precision, recall, and f1 score measures. ## conclusions in this paper, we propose a novel csc framework, namely bi-dcspell, which constitutes a bi-directional interactive detector-corrector framework, mutually enhancing the feature representation for the detection and correction sub-tasks. comprehensive experiments and empirical analyses attest to the effectiveness of our approach. the explicit modeling of bi-directional interactions between sub-tasks also holds potential significance for analogous tasks, like grammatical error correction, which deserves further research in the future.