Abstract: Masato Hagiwara, Masato Mita. Proceedings of the 12th Language Resources and Evaluation Conference.
2020.
Introduction
Modern Natural Language Processing (NLP) models, particularly those used for spelling and grammatical error correction (GEC), require vast amounts of parallel data—sentences containing errors paired with their corrected versions. Historically, researchers have relied on small datasets or noisy sources like Wikipedia, which often suffers from vandalism and semantic changes rather than simple typos. Others use automatically generated "pseudo-errors" that fail to capture the nuances of human mistakes.
The GitHub Typo Corpus fills this gap as the largest multilingual dataset of misspellings and grammatical errors to date. It contains over 350,000 edits across more than 15 languages, harvested from "before-and-after" snapshots of GitHub commits explicitly labeled as "typo."
Data Collection and Classification
The researchers developed a multi-stage pipeline to extract high-quality data from GitHub, ensuring the resulting corpus is both massive and reliable.
The process begins with selecting over 43,000 "quality" repositories based on activity and permissive licensing. The system then harvests commits where the message contains the string "typo" and extracts the "diff" (the specific lines changed). To filter out source code, the NanigoNet classifier identifies natural language text.
Finally, because not every edit in a "typo" commit is a true typo, a logistic regression classifier distinguishes typos from semantic changes using three features:
- Perplexity Ratio: Improvement in sentence fluency measured by an LSTM language model.
- Normalized Edit Distance: The character-level difference between source and target.
- Number Flag: Identifying purely numerical changes, which are typically semantic.
Dataset Characteristics
The final dataset includes 353,055 individual edits from 203,270 commits. While English is the most represented language (255k edits), the corpus provides significant data for Simplified Chinese, Japanese, Russian, French, and German.
The data reveals fascinating linguistic patterns. For instance, in Japanese, errors often involve the confusion of particles (wo, no, ni), while Chinese errors frequently involve the possessive or adjectival de.
Key Insights
- GitHub as a High-Quality Source: Unlike Wikipedia, GitHub's culture of code reviews means a second human often verifies that a "typo" commit actually fixes a typo, leading to higher data quality and minimal vandalism.
- Effective Classification: The simple three-feature classifier achieved an F1-score of ~0.9 across languages, suggesting that the signal for a typo—small edit distance combined with a significant fluency improvement—is remarkably strong.
- Benchmarking Current Tools: Industry-standard spellcheckers like Aspell and Enchant achieved an F-measure of only ~0.5 on this corpus, highlighting that real-world errors in technical documentation remain a significant challenge for current technology.
Limitations and Future Work
The dataset currently has a keyword bias, as it relies on the English word "typo" in commit messages, potentially skewing the data toward English-speaking developers. Additionally, the software-centric domain introduces technical terms (e.g., "Gemfile") not found in general writing. Future work aims to expand the dataset using multilingual keywords and exploring methods to unbias the data for broader applications.
Summary updated