Generation for Grammar Engineering

Claire Gardent, Germán KruszewskiINLG 2012

Introduction

Building large-scale computational grammars is a complex engineering challenge. As rules and lexical entries proliferate, their interactions become increasingly difficult to predict. Traditional evaluation methods typically rely on "treebank-based evaluation," which checks if a grammar can successfully parse a corpus of existing sentences. However, this approach suffers from two significant limitations: under-generation (failing to identify what the grammar cannot do outside the test set) and over-generation (failing to detect when a grammar accepts ungrammatical strings).

This paper introduces GRADE (GRAmmar DEbugger), a tool that utilizes natural language generation to "stress test" grammars. By forcing a grammar to produce sentences from scratch, GRADE identifies "dead-end" rules that can never complete a derivation and uncovers instances where the grammar produces linguistically invalid output.

The GRADE Methodology

GRADE performs a top-down traversal of a grammar to generate sentences. Unlike traditional parsers that seek a path from a string to a root symbol, GRADE explores the generative capacity of the grammar starting from its production rules.

Technical Features

The algorithm is designed with several key features to ensure practical utility:

  • Grammar Neutrality: While the authors demonstrate GRADE using Feature-Based Lexicalised Tree Adjoining Grammar (FB-LTAG), the underlying algorithm is compatible with any generative grammar using start symbols and production rules.
  • Termination Controls: To handle the potential for infinite recursion in natural language, GRADE implements "circuit breakers," including time-outs, limits on recursive rule applications, and maximum tree depth constraints.
  • Semantic Guidance: To ensure meaningful output, GRADE can be guided by input semantics. For instance, a user can constrain the generation to specific concepts, such as "running" and "John."
Figure 1: Example of an FB-LTAG tree structure with semantic annotations for the sentence "John runs often."

The implementation leverages Prolog’s built-in search mechanisms by translating FB-LTAG rules into Definite Clause Grammars (DCG), allowing for efficient exploration of the grammar space.

Evaluation: The SEMTAG Grammar

The researchers evaluated GRADE using SEMTAG, a large-scale FB-LTAG for French. SEMTAG consists of approximately 1,500 elementary trees and covers core French syntax, including complex verbal constructions and various non-verbal constituents.

Key Insights and Results

The use of generation as a debugging tool revealed several critical issues within the SEMTAG grammar that were previously undetected by parsing-based methods.

Identifying "Dead Rules"

One of the most significant findings was the discovery of "dead-end" rules—rules that are syntactically valid in isolation but logically impossible to complete within the context of the full grammar. If a rule requires a specific feature (e.g., a particular verb tense) that no other part of the grammar provides, it can never lead to a successful derivation. GRADE identifies these by flagging rules that fail to produce a complete sentence.

Quantifying Incompleteness

The evaluation revealed that approximately 10% (135 out of 1317) of the grammar rules in SEMTAG could not yield a complete derivation. As shown in the table below, certain "families" of rules exhibited failure rates as high as 80%.

Figure 2: Failure rates across different tree families in the SEMTAG grammar, highlighting significant incompleteness in specific categories.

Detecting Over-generation

Generation acts as a mirror for the grammar's "looseness." While a parser might find a single valid path for a sentence, generation forces the system to explore all possible paths. This process made errors in agreement (such as subject-verb mismatches) and clitic placement immediately obvious. GRADE successfully pinpointed four major sources of over-generation in the French grammar, including failures in enforcing agreement between inverted subject clitics and verbs.

Efficiency and Variant Exploration

Despite the computational complexity inherent in generation, runtimes remained manageable, ranging from a few seconds to a few minutes. Furthermore, by providing underspecified semantic requests, GRADE could map out a grammar's "linguistic neighborhood." In one test, an underspecified request generated nine times more sentences than a fully specified one, showcasing the grammar's breadth in producing morphological and syntactic variants (e.g., active vs. passive).

Conclusion and Future Directions

GRADE demonstrates that generation is a powerful complement to parsing for grammar engineering. It effectively identifies both under-generation (via dead rules) and over-generation.

Currently, the primary limitation is the requirement for manual review by a linguist to identify ungrammatical outputs. Future work aims to address this through automated sorting using statistical language models and educational applications for automated exercise generation.

Summary updated

BibTeX
@inproceedings{gardent2012generation,
  author = {Claire Gardent and Germán Kruszewski},
  title = {{Generation for Grammar Engineering}},
  booktitle = {INLG},
  year = {2012},
}
Figure