A BERT-based Unsupervised Grammatical Error Correction Framework

Nankai Lin, Hongbin Zhang, Menglan Shen, Yu Wang, Shengyi Jiang, Aimin YangarXiv 2023 · DOI

Introduction

Grammatical Error Correction (GEC) is a critical component of modern writing assistance tools. However, state-of-the-art systems typically rely on supervised learning, requiring vast amounts of parallel corpora—sentences paired with human-corrected versions. This dependency creates a significant barrier for "low-resource" languages like Tagalog and Indonesian, where such annotated datasets are scarce or non-existent.

To address this, researchers have developed a novel unsupervised GEC framework that leverages the pre-trained contextual knowledge of BERT. By introducing a "multi-order pseudo-perplexity" scoring mechanism, the system can identify and correct errors without any human-labeled training data.

Methodology

The proposed framework operates through three primary modules:

1. Data Flow Construction

The system first identifies target words based on their Part of Speech (POS). For each target, it generates a list of potential candidates from a predefined "confusion set." For example, a personal pronoun like "he" might be replaced with "she," "it," or "they" to test for the most fluent fit within the specific context.

2. Sentence Perplexity Scoring

Standard perplexity is difficult to calculate with BERT because it is a non-autoregressive model (it processes the entire sentence simultaneously). The authors overcome this by using Pseudo-Perplexity (PLL):

  • First-order PLL: The model masks one token at a time and calculates the likelihood of the original token given the surrounding context.
  • Second-order PLL: Two successive tokens are masked. This "stress test" forces the model to rely more heavily on syntactic structure. If a sentence is ungrammatical, the model's ability to recover these two missing pieces drops significantly more than in a grammatical sentence.

The final fluency metric is a weighted fusion of these two scores.

3. Error Detection and Correction

The system evaluates the original sentence against variants where the target word is replaced by candidates from the confusion set. The version that yields the lowest perplexity (highest fluency) is selected as the correction.

Experimental Results

The framework was evaluated on Tagalog and Indonesian datasets. For Tagalog, a new evaluation corpus of 12,953 samples across eight error types was developed.

Performance Comparison

The BERT-based method demonstrated substantial improvements over the previous state-of-the-art (SOTA) unsupervised baseline, IndoGEC.

Table 1: Performance comparison between the IndoGEC baseline and the proposed BERT-based method across various error types.

In Tagalog, the model achieved a staggering 201.48% improvement in the $F_{0.5}$ macro score for personal pronouns. In Indonesian, the method outperformed the SOTA by 20.05% in macro $F_{0.5}$ scores.

Ablation Study

Ablation studies confirmed the value of the multi-order approach. While first-order perplexity is a strong primary signal, the addition of second-order perplexity provides a critical boost for catching subtle syntactic errors.

Table 2: Ablation study results showing the impact of removing first-order or second-order pseudo-perplexity (PLL) components.

Conclusion and Future Work

This research demonstrates that BERT can serve as an effective unsupervised "fluency judge" for GEC in low-resource languages. The multi-order PLL approach effectively captures complex grammatical dependencies that traditional models miss. Future work will focus on scaling this framework to handle larger confusion sets and exploring multilingual models that can support multiple low-resource languages simultaneously.

Summary updated

BibTeX
@misc{lin2023bert,
  author = {Nankai Lin and Hongbin Zhang and Menglan Shen and Yu Wang and Shengyi Jiang and Aimin Yang},
  title = {{A BERT-based Unsupervised Grammatical Error Correction Framework}},
  year = {2023},
  eprint = {2303.17367},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2303.17367},
}
Figure