NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Combining Trigram-based and Feature-based Methods for Context-Sensitive Spelling Correction

Andrew R. Golding, Yves SchabesACL 1996

Introduction

Traditional spell-checkers are designed to identify "non-words"—character strings absent from a lexicon. However, a significant portion of spelling errors (estimated between 25% and 50%) result in valid words that are contextually inappropriate, such as substituting peace for piece. Addressing these "valid-word" errors requires context-sensitive correction. This paper presents Tribayes, a hybrid system that integrates part-of-speech (POS) trigrams with a feature-based Bayesian classifier to achieve state-of-the-art performance in context-sensitive spelling correction.

The Tribayes Approach

The core innovation of Tribayes lies in its hybrid logic, which leverages the complementary strengths of two distinct statistical methods:

  1. POS-based Trigrams: This method models the syntactic structure of a sentence by calculating the probability of sequences of Part-of-Speech tags. By substituting words from a "confusion set" (e.g., {their, there, they're}) and evaluating the resulting tag sequences, the system identifies the most syntactically likely candidate. This approach is memory-efficient and robust for syntactic errors but falters when candidates share the same POS tag.
  2. Feature-based Bayesian Classifier: This method identifies specific "features" in the surrounding context, such as nearby words or local collocations. It is particularly effective at distinguishing words that are syntactically identical (same POS) but semantically distinct, such as peace and piece.

Tribayes employs a simple yet effective switching mechanism: if the candidates in a confusion set have different POS tags in the current context, the system relies on the Trigram method. If the tags are identical, it defaults to the Bayesian classifier.

Experimental Methodology

The system was trained and evaluated using the Brown Corpus, a standard 1-million-word collection of American English, with an 80/20 train-test split. The researchers focused on 18 confusion sets derived from the Random House handbook of "Words Commonly Confused," including sets like {its, it's}, {affect, effect}, and {principal, principle}.

Results and Discussion

Tribayes demonstrated superior accuracy across the majority of confusion sets, frequently achieving scores between 90% and 99%. The hybrid approach successfully mitigated the "Same Tag" trap, where trigram models often revert to a simple frequency-based baseline.

System scores for individual and hybrid methods across 18 confusion sets.

As shown in the results, the hybrid system (TB) consistently matches or outperforms the individual Trigram (T) and Bayesian (B) components. For instance, in the {peace, piece} set, where both words are nouns, the Trigram method provides no improvement over the baseline (44.0%), whereas the Bayesian component elevates performance to 90.0%, which the hybrid system successfully adopts.

Comparison with Industry Standards

To benchmark its performance, Tribayes was compared against the grammar checker in Microsoft Word 7.0. The evaluation measured the systems' ability to both leave correct usage untouched and identify intentionally "corrupted" text.

Comparison of Tribayes and Microsoft Word 7.0 on correct and corrupted text.

Tribayes proved significantly more robust in error detection. While Microsoft Word often maintained high accuracy on correct text, it was extremely conservative in suggesting corrections. For the {than, then} set, Tribayes correctly identified 85.8% of errors, while Word identified only 22.2%. In several categories, Word failed to identify any errors (0.0%), whereas Tribayes maintained substantial coverage.

Conclusion

By combining syntactic POS trigrams with semantic Bayesian features, Tribayes offers a powerful solution for context-sensitive spelling correction. Future work will focus on scaling the system to handle thousands of confusion sets and exploring methods for the automatic discovery of new sets from large-scale corpora.

Summary updated

BibTeX
@inproceedings{golding1996combining,
  author = {Andrew R. Golding and Yves Schabes},
  title = {{Combining Trigram-based and Feature-based Methods for Context-Sensitive Spelling Correction}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {1996},
  doi = {10.3115/981863.981873},
}
Figure