Abstract
Surface generation—the process of converting semantic logical forms into human-readable text—has traditionally been a computational bottleneck in Natural Language Processing. This paper, originally presented at COLING 1994, introduces a novel approach that adapts LR-parsing techniques from compiler theory to the generation task. By inverting logic grammars and implementing "functor merging," the proposed algorithm processes multiple grammar rules in parallel, significantly reducing search space and improving efficiency over previous state-of-the-art methods like Semantic-Head-Driven Generation (SHDG).
Introduction
In the field of NLP, while significant progress has been made in parsing (reading), surface generation (speaking) remains a challenge. The core difficulty lies in the "blind" nature of traditional generators, which often explore numerous incorrect paths before finding a valid string for a given logical form. This paper addresses this "spurious search" problem by treating generation as a specialized form of parsing.
The Problem: Spurious Search in SHDG
The standard approach at the time of this research was Semantic-Head-Driven Generation (SHDG). SHDG typically evaluates grammar rules sequentially. If multiple rules could potentially initiate a sentence with the same semantic meaning, SHDG might explore each one to completion before backtracking. This leads to massive computational waste, especially in complex grammars where many rules share initial semantic components.
Methodology: LR-Parsing for Generation
The author proposes an algorithm that borrows from LR-compilation techniques used in programming language compilers. The approach consists of several key components:
1. Grammar Inversion and Functor Merging
The grammar is first reformulated based on the "functor-argument" structure of the logical forms rather than surface word order. The central innovation is functor merging. In LR parsing, "prefix merging" allows a parser to handle multiple rules simultaneously if they share a common prefix. Samuelsson applies this to generation: the algorithm processes different rule combinations that introduce the same semantic piece in parallel until they diverge. This "lazy" commitment prevents the system from falling into unnecessary search branches.
2. LR-Generation Tables
The algorithm utilizes compiled tables (descend, goto, and reduce) to navigate the logical form. Unlike a standard parser that tracks positions in a text string, the "dotted items" in these tables track progress within the arguments of the logical form. This turns a complex search problem into a more straightforward table-lookup and stack-manipulation task.
3. Semantic Lookahead
Similar to LR(k) parsing, the generator can "peek" into the depth of the logical form to resolve ambiguities early. This lookahead is a tunable parameter, allowing developers to trade memory (larger tables) for speed (less nondeterminism).
Key Insights and Results
- Generation as Parsing: By treating the logical form as the input "string," generation becomes a deterministic process.
- Search Space Reduction: Functor merging effectively collapses multiple search paths, resulting in a much smaller search space compared to the SHDG baseline.
- Practical Implementation: Beyond theoretical demonstration, the system was successfully integrated into the DISCO HPSG-based NLP system, proving the algorithm's viability for complex, real-world grammars.
Limitations and Future Work
While the algorithm provides a robust foundation, some manual configuration was initially required to specify argument flow during grammar inversion. The author noted that automating this step and conducting a rigorous empirical performance evaluation against SHDG were primary goals for future development.
Summary updated