Abstract
Some grammatical error correction (GEC) systems incorporate hand-crafted rules and achieve positive results. However, manually defining rules is time-consuming and laborious. In view of this, we propose a method to mine error templates for GEC automatically. An error template is a regular expression aiming at identifying text errors. We use the web crawler to acquire such error templates from the Internet. For each template, we further select the corresponding corrective action by using the language model perplexity as a criterion. We have accumulated 1,119 error templates for Chinese GEC based on this method. Experimental results on the newly proposed CTC-2021 Chinese GEC benchmark show that combining our error templates can effectively improve the performance of a strong GEC system, especially on two error types with very little training data.
Introduction
Grammatical Error Correction (GEC) is currently dominated by large-scale neural models, such as Transformers, trained on millions of sentence pairs. While powerful, these "black box" models require enormous amounts of labeled data and can be difficult to control. In contrast, rule-based GEC systems use hand-crafted templates (e.g., "if you see X, change it to Y") which are fast, interpretable, and require zero training data. However, manually writing thousands of rules is a Herculean task.
This paper proposes a clever hybrid approach: automating the creation of rule-based grammar checkers by "mining" common errors from public Q&A websites and using pre-trained language models to determine the best way to fix them. This approach significantly improves performance on native-speaker error datasets, particularly for redundancy-related mistakes where traditional neural models often struggle.
Methodology
The researchers developed a two-stage pipeline to automate rule discovery and validation:
- Template Extraction: Instead of manually defining errors, the system uses a web crawler to search Chinese Q&A platforms (like Baidu Zhidao) for specific search patterns where users ask about grammar (e.g., "Is 'A...B' a grammatical error?"). From these queries, the authors extracted 1,119 candidate templates in the form of regular expressions.
- Corrective Action Acquisition: Once a template is identified, the system must determine the fix. The authors defined three possible "delete" actions: delete the left part (A), delete the right part (B), or randomly delete one. To choose the "golden action," they utilized a pre-trained Chinese GPT-2 model. By applying each action to sentences from a large corpus and measuring Perplexity (PPL), the action resulting in the most natural-sounding sentence (lowest PPL) was selected as the official fix.
Evaluation and Results
The method was evaluated on three major Chinese GEC benchmarks: CTC-2021 (native speaker errors), and NLPCC-2018 & MuCGEC (learner errors).
Key Performance Gains
- Significant F1 Improvement: On the CTC-2021 benchmark, adding the mined templates to a strong baseline system improved the F1 score by 4.50 points (from 54.71 to 59.21).
- Targeting Redundancy: The system excelled at correcting "meaning duplicates" (e.g., saying "about... or so") and "mixed sentence patterns." For these specific types, recall jumped from roughly 8% to over 50%.
- High Precision: The error templates alone achieved a precision of 64.29%, proving that automatically mined rules can be remarkably accurate.
Discussion and Insights
One of the most innovative aspects of this work is treating public Q&A forums as a "wisdom of the crowd" data source. If users are frequently asking if a specific phrase is wrong, it is a high-probability candidate for a GEC rule. Furthermore, using LLMs as rule validators—rather than generators—keeps the system fast and prevents the hallucinations common in purely generative models.
A notable finding was that these mined templates significantly helped with native speaker errors but had minimal impact on learner datasets. This suggests that the mistakes native speakers query online are fundamentally different from the errors made by second-language students.
Limitations and Future Work
Currently, the system is constrained to errors that can be fixed by deletion (redundancy). It cannot yet handle errors requiring word substitution or insertion. Additionally, because the templates rely on regular expressions, they can occasionally trigger "false positives" due to context blindness (e.g., misidentifying parts of a proper name as a redundant pattern). Future work aims to expand the mining process to learner-focused forums to better support second-language education.
Summary updated