Seq2RDF: An End-to-end Application for Deriving Triples from Natural Language Text

Yue Liu, Tongtao Zhang, Zhicheng Liang, Heng Ji, Deborah L. McGuinness

Introduction

Extracting structured information from unstructured text is a fundamental challenge in the development of the Semantic Web. Traditionally, this process relies on a multi-stage pipeline: Entity Linking (EL) to identify subjects and objects, followed by Relation Classification (RC) to determine the semantic link between them. However, these pipelines often suffer from "error propagation," where a mistake in the initial entity linking phase irrecoverably compromises the subsequent relation classification. Furthermore, mapping natural language to the rigid, specific vocabulary of Knowledge Graphs (KGs) like DBpedia remains a significant hurdle for modular systems.

Seq2RDF addresses these issues by proposing an end-to-end framework that translates natural language sentences directly into structured RDF triples (subject-predicate-object) in a single step. By treating a Knowledge Graph as its own "language" and leveraging pre-trained KG embeddings, the model bypasses tedious feature engineering and intermediate pipeline steps.

The Seq2RDF Architecture

The core of Seq2RDF is an encoder-decoder architecture, similar to those used in Neural Machine Translation (NMT), but specifically adapted for the structured nature of RDF triples.

  • The Encoder: A Bi-directional Long Short-Term Memory (LSTM) network processes the input sentence. It utilizes domain-specific pre-trained word embeddings to capture the semantic nuances of the source text.
  • The Decoder: An LSTM equipped with an attention mechanism generates the output triple. Unlike standard decoders that rely solely on the final encoder state, this attention mechanism allows the model to "focus" on specific words in the source sentence when predicting each element of the triple.
  • Knowledge Graph Grounding: A key innovation is the initialization of the decoder using TransE embeddings. TransE represents KG entities and relations as vectors in a continuous space. By incorporating these pre-trained embeddings, the model begins with a mathematical understanding of the KG's internal relationships, providing a "semantic map" that helps it select compliant terms from the KG schema.
The Seq2RDF architecture, featuring a Bi-LSTM encoder and an attention-based decoder grounded in Knowledge Graph embeddings.

Experimental Setup

The model was evaluated on three distinct datasets to test its versatility across different domains and scales:

  1. NYT: General news articles from the New York Times.
  2. ADE: A specialized dataset focused on Adverse Drug Events in the medical domain.
  3. Wiki-DBpedia: A large-scale dataset generated via distant supervision, aligning Wikipedia text with DBpedia triples. The authors manually labeled the test set to ensure high-quality evaluation.

Results and Discussion

The Seq2RDF model (denoted as S+A+W+G, representing Seq2Seq + Attention + Word embeddings + KG embeddings) consistently outperformed all pipeline-based baselines, including those utilizing LSTMs and GRUs.

Performance comparison (F1-Measure) of Seq2RDF (S+A+W+G) against various pipeline-based baselines across three datasets.

As shown in the results, the model achieved a significant performance jump on the Wiki-DBpedia dataset, rising from a baseline of 67.0 to 84.3 F1-measure. This highlights the model's robustness when dealing with large-scale, real-world Knowledge Graph vocabularies. By merging EL and RC into a single joint optimization task, Seq2RDF effectively reduces the noise and "Out of Vocabulary" issues that typically plague standalone entity linkers.

Conclusion and Future Work

Seq2RDF demonstrates that treating triple extraction as a direct translation task is a viable and superior alternative to traditional pipeline methods. By grounding the decoder in KG-specific embeddings, the model learns the implicit "grammar" of the Knowledge Graph.

While the current iteration is limited to generating a single triple per sentence, it provides a strong foundation for future research. The authors identify several areas for expansion, including redesigning the decoder to handle multi-triple generation for complex sentences, improving the handling of rare entities, and exploring more sophisticated attention mechanisms to capture overlapping relations in dense text.

Summary updated

Abstract

We present an end-to-end approach that takes unstructured textual input and generates structured output compliant with a given vocabulary. Inspired by recent successes in neural machine translation, we treat the triples within a given knowledge graph as an independent graph language and propose an encoder-decoder framework with an attention mechanism that leverages knowledge graph embeddings. Our model learns the mapping from natural language text to triple representation in the form of subject-predicate-object using the selected knowledge graph vocabulary. Experiments on three different data sets show that we achieve competitive F1-Measures over the baselines using our simple yet effective approach. A demo video is included.
BibTeX
@inproceedings{liu2018seq,
  author = {Yue Liu and Tongtao Zhang and Zhicheng Liang and Heng Ji and Deborah L. McGuinness},
  title = {{Seq2RDF: An End-to-end Application for Deriving Triples from Natural Language Text}},
  booktitle = {ISWC (P\&D/Industry/BlueSky)},
  year = {2018},
  url = {https://openreview.net/forum?id=ZNHIEPyQZPQ},
}
Figure