# Grammar Correction for Multiple Errors in Chinese Based on Prompt Templates
## 4 Experiments
### Results and Analysis  
In the experiment, five error-correction models were selected for comparison with the model proposed in this paper, focusing on error detection and correction on the testing corpus. The specific details of the compared models are as follows:  
Model 1 [20]: iFLYTEK ZhiJian utilizes a BiLSTM-CRF model framework with CRF and introduces deep semantic features. It employs probability integration to fuse the outputs of multiple models and further optimizes the results by incorporating a template matcher. Model 2: Baidu Intelligent Cloud Text Proofreading System identifies various types of errors, including incorrect words, characters, and punctuation in Chinese texts, and provides suggestions for correction. \begin{table}
\begin{tabular}{c c} \hline \hline
**Hyperparameters** & **Settings** \\ \hline Epoch & 10 \\ Batch Size & 256 \\ Max Sequence Length & 256 \\ Learning Rate & \(1\times 10^{-5}\) \\ Dropout & 0.1 \\ Optimizer & Adam \\ Gradient Accumulation & 128 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Hyperparameter Settings. Model 3 [4]: GEToR is a sequence labeling-based grammar-correction model that uses transformer as the base model. It employs token-level correction methods, such as insertion, deletion, and replacement, to handle different types of grammatical errors. Model 4 [21]: Pycorrector (T5) is an open-source Chinese text proofreading tool available on GitHub. It fine-tunes the Langboat/mengzi-t5-base pre-trained model on the error-correction dataset. Model 5 [22]: This model is based on a convolutional encoder-decoder architecture for grammar correction. It utilizes a multi-layer convolutional neural network as both the encoder and decoder, incorporating attention mechanisms and non-linear operations to capture language context and relationships for grammar error correction. The results of the error detection and correction comparison experiments are shown in Tables 5 and 6, respectively. Table 6 introduces false negatives (FNs) as the fourth evaluation metric to validate the proposed model's effectiveness in reducing false correction rates. FN represents the number of instances where the model incorrectly identifies true positives as false negatives (incorrectly correcting correct words to incorrect words). We carried out a comparison with existing methods on a consistent evaluation dataset, MuCGEC. As can be seen in Table 5, our MacBERT-BiLSTM-CRF-based model excels in error detection, significantly surpassing other models in the F0.5 score. This is mainly due to the model's unique architecture that combines the strengths of MacBERT, BiLSTM, and CRF. MacBERT provides a comprehensive understanding of the context, while BiLSTM and CRF work in concert to capture and classify the complex grammar error patterns, thereby boosting the model's precision. Table 6 further elucidates that our model not only excels in reducing the number of FNs, i.e., correctly identified words erroneously corrected, but also maintains a balance between precision and recall, as reflected in the highest F0.5 score. It shows that our model has effectively eliminated multiple errors in the sentences, thus eliminating the issue found in Model 1 and Model 2 of sacrificing recall to achieve higher precision. This is a critical aspect in real-world applications: identifying errors as accurately as possible and ensuring that no mistakes are overlooked. To further analyze the impact of the number of grammatical errors on the model's error-correction performance, this paper divided the MuCGEC grammar-correction dataset into four subsets based on the different numbers of errors per sentence: Mu_1, Mu_2, Mu_3, and Mu_4. The Mu_1 dataset contains sentences with one error, the Mu_2 dataset contains sentences with two errors, the Mu_3 dataset contains sentences with three errors, and the Mu_4 dataset contains sentences with four or more errors. Comparative experiments were conducted on these four datasets; the results are shown in Figure 5.