Text Generation from Knowledge Graphs with Graph Transformers

Rik Koncel-Kedziorski, Dhanush Bekal, Yi Luan, Mirella Lapata, Hannaneh Hajishirzi

Authors: Rik Koncel-Kedziorski, Dhanush Bekal, Yi Luan, Mirella Lapata, Hannaneh Hajishirzi.
Source: Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies.

Introduction

Generating a single grammatical sentence is a largely solved problem in natural language processing. However, generating a coherent multi-sentence paragraph—such as a scientific abstract—remains a significant challenge. To produce high-quality text, a model requires a "document plan" that organizes complex ideas into a logical flow.

Knowledge Graphs (KGs) are ideal for representing these structured ideas. However, they present unique challenges for standard sequence-to-sequence models. KGs are non-linear, containing cycles and long-distance dependencies without a clear start or end point. Previous approaches often "linearized" these graphs into flat sequences, a process that discards the rich structural information inherent in the graph.

An example of a scientific abstract and its corresponding knowledge graph representation.

The GraphWriter Model

To address these challenges, the researchers introduced GraphWriter, a model designed to generate coherent text directly from knowledge graphs using a novel Graph Transformer architecture.

1. Graph Preparation

To effectively process labeled edges (relationships), GraphWriter converts the KG into a bipartite graph. In this setup, every relationship (e.g., "used-for") is treated as a distinct node. Additionally, a global context node is introduced and connected to every entity node. This global node provides the model with a "big picture" view, helping maintain document-level coherence.

2. The Graph Transformer Encoder

Unlike standard Graph Attention Networks (GATs) that primarily aggregate information from immediate neighbors, the Graph Transformer applies multi-headed self-attention across the entire graph structure. This allows information about any given entity to be contextualized by the global graph structure over multiple layers, capturing long-range dependencies that are crucial for document planning.

The GraphWriter architecture, integrating a Graph Transformer encoder with a title encoder and an attention-based decoder.

3. The Decoder and Copy Mechanism

The model utilizes an attention-based decoder equipped with a copy mechanism. Scientific text often requires the use of specific, low-frequency technical terms. The copy mechanism allows the decoder to "point" to specific nodes in the input KG and insert those exact terms into the generated text, ensuring technical accuracy and reducing the burden on the model's fixed vocabulary.

The AGENDA Dataset

The paper also introduces the Abstract GENeration DAtaset (AGENDA), a new benchmark for this task. AGENDA consists of 40,000 paper titles and abstracts from 12 top AI conferences. The knowledge graphs were automatically extracted using a state-of-the-art Information Extraction system (SciIE). This makes AGENDA a more realistic and scalable testbed compared to previous datasets that relied on manually curated tables.

Key Results

GraphWriter significantly outperformed several baselines in both automated and human evaluations:

  • Automated Metrics: GraphWriter achieved a BLEU score of 14.3, outperforming a standard GAT baseline (12.2) and a model using only a "bag of entities" (10.3).
  • Human Evaluation: In "Best-Worst" scaling tests, human experts preferred GraphWriter's output for its superior Structure and Grammar, with a 63% win rate over models that did not utilize the full graph structure.
  • Qualitative Analysis: The model demonstrated a better ability to use entities from the input graph and arrange them in a more articulated textual context.

Conclusion and Future Work

The GraphWriter model demonstrates that preserving the structural information of Knowledge Graphs is key to generating coherent, multi-sentence text. While the model represents a significant step forward, challenges remain. The authors noted that the model occasionally "forgets" to include all entities from the input graph (a coverage problem) and can sometimes produce repetitive sentences. Future work may involve incorporating "coverage loss" functions or more advanced pruning techniques to further improve the quality of generated abstracts.

Summary updated

BibTeX
@inproceedings{koncelkedziorski2019text,
  author = {Rik Koncel-Kedziorski and Dhanush Bekal and Yi Luan and Mirella Lapata and Hannaneh Hajishirzi},
  title = {{Text Generation from Knowledge Graphs with Graph Transformers}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2019},
  url = {https://openreview.net/forum?id=r1N2CGZOZH},
}
Figure