Structuring Documents Efficiently

Robert Marshall, Steven Bird, Peter J. Stuckey

Abstract

Automated natural language generation requires mapping abstract rhetorical structures to formatted document layouts. This "mapping problem" often suffers from exponential computational complexity. This paper presents a constraint logic programming approach that utilizes reified constraints and pruning techniques to efficiently find optimal document structures. By integrating stylistic defect scoring directly into the search process, the proposed method significantly outperforms exhaustive search strategies, enabling the generation of high-quality layouts for complex texts.

Introduction

In natural language generation, a fundamental distinction exists between rhetorical structure—the logical relationships between ideas—and document structure—the physical layout on a page. A single rhetorical meaning can be realized through numerous layouts, such as bulleted lists, nested clauses, or separate paragraphs.

Example of a rhetorical structure tree where a claim is supported by a list of evidence.

The challenge lies in selecting the "optimal" layout, typically defined as the one with the fewest stylistic "defects." Previous approaches attempted exhaustive generation and testing, which becomes computationally infeasible as document size increases. This research addresses the need for a scalable solution to this mapping problem.

The Mapping Problem

The mapping problem involves transforming a logical tree into a document tree. For instance, a list of items in the rhetorical structure can be rendered as a bulleted list in the document structure.

A logical list structure mapped to a bulleted list format.

As the number of logical nodes grows, the possible permutations of layout choices (indentation, connectives, positioning) explode exponentially.

Methodology: Constraint Logic Programming

The authors implement their solution using Constraint Logic Programming (CLP) in SICStus Prolog. Rather than generating all possibilities, the system treats document generation as a constraint satisfaction problem aimed at minimizing an objective function of stylistic defects.

Technical Components

  • Reified Constraints: Boolean variables are used to flag violations of stylistic rules, such as placing a "satellite" before a "nucleus" in a rhetorical relation.
  • Pruning: The search space is pruned by terminating the exploration of any branch where the cumulative defect count exceeds the current best solution.
  • Search Heuristics: Several techniques were evaluated to optimize search speed, including tree-traversal labelling (following the document hierarchy) and Limited-Discrepancy Search (LDS), which prioritizes heuristic guesses while allowing controlled deviations.

Experimental Evaluation

The system was tested using Marcu’s rhetorical structure corpus (2000). The researchers extracted rhetorical structures of varying sizes to measure the efficiency of finding optimal layouts.

Key Findings

  • Simultaneous Evaluation: Pruning the search space during construction, rather than post-generation, is critical for performance.
  • Variable Ordering: The order of variable assignment significantly impacts efficiency. Assigning "Level" and "Position" variables first using tree-traversal proved most effective, as these variables are highly dependent on their hierarchical parents.
  • Scalability: For complex structures, LDS was necessary to find near-optimal solutions within reasonable time limits (e.g., 100,000 assignments).

Results

The CLP approach successfully identified optimal solutions (0 to 2 defects) for most test cases where previous exhaustive methods timed out. The choice of labelling strategy was found to alter search time by up to a factor of four, highlighting the importance of domain-specific heuristics in constraint problems.

Conclusion and Future Work

While the constraint programming approach offers significant efficiency gains, the problem remains NP-hard. Future work includes improving the integration of discourse connectives (e.g., "however," "therefore") to avoid "ugly" output and further tuning search discrepancies for very large rhetorical structures. This research demonstrates that integrating stylistic constraints directly into the generation process is a viable path toward efficient, high-quality automated document design.

Summary updated

BibTeX
@inproceedings{marshall2005structuring,
  author = {Robert Marshall and Steven Bird and Peter J. Stuckey},
  title = {{Structuring Documents Efficiently}},
  booktitle = {ALTA},
  year = {2005},
}
Figure