Parser Features for Sentence Grammaticality Classification

Sze-Meng Jojo Wong, Mark Dras

Introduction

In Natural Language Processing (NLP), the ability to automatically determine if a sentence is grammatical is a foundational challenge. This task has significant implications for applications such as automated essay grading, grammar checking, and the evaluation of machine translation outputs. Historically, researchers have relied on "parser byproducts"—aggregate metadata such as the total time taken to parse a sentence or the overall probability score assigned to the final parse tree. However, these holistic scores often obscure the specific structural details of an error.

This paper investigates whether the internal logic of a natural language parser—specifically the Context-Free Grammar (CFG) production rules it utilizes—can serve as a more granular signal for classification. By analyzing the specific structural building blocks (e.g., VP -> VBD NP) used to construct a parse tree, the authors aim to identify "suspicious" patterns characteristic of ungrammatical text.

Methodology

The research was conducted in two primary stages: parser optimization and feature engineering.

Parser Optimization

Standard parsers are often engineered for robustness, meaning they are designed to find a valid structure even in the presence of noise. To prevent the parser from simply "breaking" or overly smoothing errors, the authors re-trained the Stanford Parser on three distinct datasets: purely grammatical text, purely ungrammatical text, and a mixture of both.

Table 3: Parser performance across different training sets (Pure, Noisy, Mixed) and test corpora.

As shown in the experimental results above, an integrated approach—parsing a sentence with both a "pure" and a "noisy" model and selecting the result with the higher probability—yielded the most robust performance across different levels of data quality.

Feature Extraction and Selection

Once a stable parser was established, the authors extracted CFG production rules from the resulting trees. Given the high dimensionality of the feature space (over 26,000 unique rules), several feature selection metrics were employed to identify the most discriminative rules:

  • Frequency (FREQ): Selecting the most common rules.
  • Ratio: Identifying rules that appear disproportionately in one class over the other.
  • Information Gain (IG): Selecting rules that best reduce uncertainty regarding the sentence's classification.
  • Bi-normal Separation (BNS): A metric designed to distinguish between two distributions, particularly effective for identifying features that characterize broken sentences.

Data and Experimental Setup

The study utilized the Penn Treebank (Wall Street Journal corpus) as the gold standard for grammatical data. For ungrammatical data, the authors used the NoisyWSJ and NoisierWSJ datasets. These corpora consist of Penn Treebank sentences programmatically distorted with insertions, deletions, and substitutions based on real-world error patterns found in digital communications.

Key Results and Analysis

The primary baseline for the study was the use of standard parse probabilities alone. This "byproduct" method achieved an accuracy of 65.42% on moderately noisy data and 74.19% on very noisy data.

By augmenting these probabilities with specific production rules selected via BNS or Information Gain (IG-FREQ), the authors observed a statistically significant performance boost.

Table 6: Classification accuracy improvement when combining parse probabilities with selected production rules (IG-FREQ and BNS).

While the average improvement of approximately 1.6% may appear modest, it confirms that the internal structure of the parse tree contains unique signals that aggregate probability scores miss. Furthermore, the study revealed an "Oracle Gap": when using "Gold Standard" production rules (the true rules if the parser were perfect), performance jumped significantly. This suggests that the primary bottleneck in grammaticality detection is not the classification algorithm, but the parser's tendency to "smooth over" errors during the tree-building process.

Discussion and Limitations

The research highlighted several ongoing challenges in the field:

  1. Substitution Errors: The parser struggled most with substitution errors (e.g., using "is" instead of "for"). If the substituted word fits the expected part-of-speech, the parser may produce a structurally valid but semantically nonsensical tree.
  2. Feature Sparsity: Many of the 26,000+ rules appear infrequently, making it difficult for machine learning models to learn their significance reliably.
  3. Synthetic vs. Real-world Errors: While the synthetic errors used in this study mimic real-world patterns, errors from English Second Language (ESL) learners may be more complex and less constrained.

Future work may involve exploring "vertical" slices of the parse tree (parent-grandparent relationships) to capture more context or integrating structural features with word n-grams to better detect substitution-based errors.

Summary updated

BibTeX
@inproceedings{wong2010parser,
  author = {Sze-Meng Jojo Wong and Mark Dras},
  title = {{Parser Features for Sentence Grammaticality Classification}},
  booktitle = {Alta},
  year = {2010},
}
Figure