Path-Based Contextualization of Knowledge Graphs for Textual Entailment

Kshitij Fadnis, Kartik Talamadupula, Pavan Kapanipathi, Haque Ishfaq, Salim Roukos, Achille Fokoue · DOI

Abstract

In this paper, we introduce the problem of knowledge graph contextualization -- that is, given a specific NLP task, the problem of extracting meaningful and relevant sub-graphs from a given knowledge graph. The task in the case of this paper is the textual entailment problem, and the context is a relevant sub-graph for an instance of the textual entailment problem -- where given two sentences p and h, the entailment relationship between them has to be predicted automatically. We base our methodology on finding paths in a cost-customized external knowledge graph, and building the most relevant sub-graph that connects p and h. We show that our path selection mechanism to generate sub-graphs not only reduces noise, but also retrieves meaningful information from large knowledge graphs. Our evaluation shows that using information on entities as well as the relationships between them improves on the performance of purely text-based systems.

Introduction

Natural Language Inference (NLI), or textual entailment, is the task of determining whether a premise sentence entails, contradicts, or is neutral toward a hypothesis sentence. While modern deep learning models have achieved high performance on these tasks, they often struggle with reasoning that requires external "common sense" knowledge.

Integrating Knowledge Graphs (KGs) like ConceptNet offers a potential solution, but it presents two significant challenges: noise and information loss. KGs are vast, and many connections are irrelevant to a specific sentence pair; simple neighborhood extraction often introduces more noise than signal. Furthermore, most existing KG-augmented NLI models focus solely on entities (nodes), ignoring the rich semantic information contained in the relationships (edges) between them. This paper addresses these issues by proposing a "contextualization" method that extracts task-relevant sub-graphs and a model that explicitly encodes both entities and their relationships.

Methodology

Contextualizing the Knowledge Graph

The core of the approach is identifying the most informative paths between concepts in the premise and hypothesis. To do this effectively, the authors move beyond simple hop-counts and introduce customized cost functions for the KG edges to find the most relevant multi-hop paths:

  1. Default Cost (DC): A baseline where every edge has a weight of 1.0.
  2. Relation Frequency (RF): Weights edges based on the local frequency of a relation for a given node, favoring connections that are more specific to that node.
  3. Global Relation Frequency (GRF): Inspired by TF-IDF, this heuristic uses "Inverse Node Frequency" to down-weight ubiquitous relations (like IsA) and promote rare, highly specific relations that are more likely to provide critical context for entailment.

After identifying all concepts in the premise and hypothesis that map to ConceptNet, the system finds the shortest paths between every premise-hypothesis entity pair using these customized costs.

Hierarchical Graph Recurrent Network (GRN)

To process the extracted sub-graphs, the authors propose a hierarchical architecture designed to capture the sequential nature of paths while integrating both node and edge information.

The hierarchical Graph Recurrent Network (GRN) architecture for encoding paths between premise and hypothesis entities.

The model consists of several layers:

  • Token-level Encoder: A Bi-GRU processes each path as a sequence of alternating entities and relations.
  • Pair-level Encoder: A second Bi-GRU aggregates the representations of all paths found for a specific entity pair (e.g., the paths between "wind" in the premise and "winds" in the hypothesis).
  • Integration: The final graph-based representation is concatenated with the output of a standard text-based model (match-LSTM) before being passed to a fully connected layer for classification.

Experimental Results

The model was evaluated on three benchmarks: SNLI (general domain), SciTail (science domain), and BreakingNLI (lexical reasoning).

The Importance of Relations

A key finding of this research is that the specific types of relationships between entities are crucial for NLI. As shown in the ablation study, including relationship information consistently provides a greater performance boost than using entities alone.

Performance comparison of different heuristics and feature sets across SciTail, SNLI, and BreakingNLI datasets.

The results demonstrate that the GRN + mLSTM model consistently outperforms the text-only baseline. On the SciTail dataset, accuracy improved from 82.54% to 85.42% when using the GRF heuristic. Furthermore, the GRF heuristic generally outperformed DC and RF, validating the idea that filtering out common relations helps the model focus on salient information. On average, including both relations and entities provided a 2.6% improvement over the baseline.

Comparison with State-of-the-Art

The proposed method outperformed existing KG-augmentation techniques like ConSeqNet and KES on SciTail and SNLI. While it performed slightly below the KIM model on BreakingNLI, it is important to note that KIM utilizes WordNet—the primary source used to construct the BreakingNLI dataset—giving it a significant domain-specific advantage.

Conclusion

This work demonstrates that path-based contextualization is an effective way to integrate large-scale external knowledge into NLI tasks. By treating paths as sequences of both entities and relationships and using frequency-based heuristics to filter noise, the proposed GRN model achieves significant improvements over purely text-based systems. Future work will explore more sophisticated path selection mechanisms and ways to handle the computational complexity of large-scale graph traversal.

Summary updated

BibTeX
@misc{fadnis2019path,
  author = {Kshitij Fadnis and Kartik Talamadupula and Pavan Kapanipathi and Haque Ishfaq and Salim Roukos and Achille Fokoue},
  title = {{Path-Based Contextualization of Knowledge Graphs for Textual Entailment}},
  year = {2019},
  eprint = {1911.02085},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1911.02085},
}
Figure