Generating Knowledge Graph Paths from Textual Definitions using Sequence-to-Sequence Models

Victor Prokhorov, Mohammad Taher Pilehvar, Nigel Collier

This research, presented at NAACL-HLT 2019, introduces a novel framework for linking natural language to structured knowledge. Rather than treating entity mapping as a standard classification or vector-space projection task, the authors frame it as a translation problem: converting a textual definition into a hierarchical path within a Knowledge Graph (KG).

The Text-to-Entity Mapping Problem

Text-to-entity mapping—associating a snippet of text with a specific concept in an ontology—is a foundational task in NLP. Traditional methods typically project text into a high-dimensional vector space to find the "nearest" entity. However, these methods face two significant challenges:

  1. Dependency on Predefined Embeddings: Performance is often limited by the quality of the underlying vector space (e.g., Word2Vec or Node2Vec).
  2. Interpretability: These "black box" models offer little insight into why a specific entity was chosen, making error analysis difficult.

The authors argue that by predicting the explicit path from the root of the ontology to the target entity, models can better leverage hierarchical information and provide a traceable decision-making process.

Methodology: Paths as Sequences

The researchers utilize a standard Sequence-to-Sequence (Seq2Seq) architecture with an Attention mechanism:

  • Encoder: A bi-directional LSTM processes the textual definition (e.g., "a small bird that resembles a swallow") into a latent representation.
  • Decoder: An LSTM predicts the sequence of nodes or edges constituting the path in the KG.
  • Attention: This allows the model to focus on specific words in the definition while predicting each step in the path. For example, the word "bird" might trigger the prediction of a bird node in the hierarchy.

Two path representations were tested: text2nodes (predicting entity labels) and text2edges (predicting edge indices). The text2edges approach proved more efficient, as the output vocabulary is limited to the maximum branching factor of the graph rather than the total number of nodes.

Experimental Setup and Datasets

The model was evaluated on seven ontologies across bio-medical and general lexical domains, including PATO (Phenotype), GO (Gene Ontology), and subgraphs of WordNet 3.0. To facilitate the Seq2Seq approach, the authors preprocessed these Directed Acyclic Graphs (DAGs) into rooted trees.

Figure 5: Distribution of sequence lengths in the WordNet Plant subgraph, showing a concentration of paths between 3 and 5 nodes long.

Performance and Interpretability

Using the Ancestor-F1 score—which rewards the model for correctly identifying hierarchical ancestors even if the final leaf node is incorrect—the text2edges model consistently outperformed state-of-the-art baselines like MS-LSTM.

Key findings include:

  • Topological Awareness: The decoder learns the dependencies of the ontology, ensuring that predicted nodes logically follow their parents.
  • Robustness: On the large WNentity graph (~74k nodes), the model achieved an Ancestor-F1 of 0.65, far exceeding the 0.41 achieved by a Bag-of-Words baseline.
  • Validity: Despite the unconstrained nature of the decoder, the percentage of invalid paths (sequences not existing in the graph) remained remarkably low (1.8% to 8.5%).

Limitations and Future Directions

While the model shows strong performance, it currently requires data to be structured as rooted trees. Extending the framework to handle general DAGs or cyclic graphs is a primary goal for future work.

Additionally, error analysis revealed a "length bias." The model tends to gravitate toward the most frequent path lengths found in the training data, often under-generating or over-generating lengths for rare cases.

Figure 2: Correlation between gold sequence length and decoded sequence length for the PATO dataset, illustrating the model's tendency to pull predictions toward the mean path length.

To address these issues, the authors suggest implementing a context-free grammar (CFG) to strictly constrain the decoder, ensuring it only produces valid paths existing within the target knowledge graph.

Summary updated

BibTeX
@inproceedings{prokhorov2019generating,
  author = {Victor Prokhorov and Mohammad Taher Pilehvar and Nigel Collier},
  title = {{Generating Knowledge Graph Paths from Textual Definitions using Sequence-to-Sequence Models}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2019},
  doi = {10.18653/v1/n19-1196},
}
Figure