Relation Classification via Recurrent Neural Network

Dongxu Zhang, Dong Wang · DOI

Abstract

Deep learning has gained much success in sentence-level relation classification. For example, convolutional neural networks (CNN) have delivered competitive performance without much effort on feature engineering as the conventional pattern-based methods. Thus a lot of works have been produced based on CNN structures. However, a key issue that has not been well addressed by the CNN-based method is the lack of capability to learn temporal features, especially long-distance dependency between nominal pairs. In this paper, we propose a simple framework based on recurrent neural networks (RNN) and compare it with CNN-based model. To show the limitation of popular used SemEval-2010 Task 8 dataset, we introduce another dataset refined from MIMLRE(Angeli et al., 2014). Experiments on two different datasets strongly indicates that the RNN-based model can deliver better performance on relation classification, and it is particularly capable of learning long-distance relation patterns. This makes it suitable for real-world applications where complicated expressions are often involved.

Introduction

Relation classification is a fundamental task in Natural Language Processing (NLP) aimed at identifying semantic connections between entity pairs within a sentence. For instance, in the sentence "The apple fell from the tree," a system should identify the relationship Entity-Origin(apple, tree). While traditional methods relied on manual feature engineering, Convolutional Neural Networks (CNNs) have recently become popular due to their ability to automatically learn features. However, CNNs typically utilize fixed-size windows, which limits their ability to capture long-distance dependencies between entities. This paper proposes a Recurrent Neural Network (RNN) based framework designed to better model these temporal features and handle complex, long-distance patterns.

Methodology

The proposed framework consists of three primary layers designed to capture sequential information effectively across the entire sentence.

The proposed RNN-based architecture for relation classification, featuring embedding, bidirectional recurrent, and max-pooling layers.

1. Word Embedding Layer

Words are mapped into dense vectors using pre-trained word2vec embeddings. This provides the model with a robust initial understanding of lexical semantics before processing the specific context of the sentence.

2. Bidirectional Recurrent Layer

The core of the model is a Bidirectional RNN (Bi-RNN). By processing the sentence in both forward and backward directions, the model generates representations for each word that incorporate context from both the past and the future. This allows the model to accumulate meaning across the entire sequence between entities.

3. Max-Pooling Layer

To mitigate the "forgetting" issue common in standard RNNs—where the final hidden state may lose information from the beginning of long sentences—a max-pooling layer is applied across all time steps. This operation identifies and preserves the most salient features discovered anywhere in the sentence.

Position Indicators (PI)

A notable innovation in this framework is the use of Position Indicators. Instead of calculating explicit numerical distances (Position Features), the model uses special tags (e.g., <e1>...</e1>) to wrap target entities. This allows the RNN to learn positional context naturally during sequential processing, offering a more elegant solution than the rigid architectural tweaks often required for CNNs.

Experiments and Results

The model was evaluated on two datasets: the standard SemEval-2010 Task 8 and a more challenging dataset introduced by the authors, KBP37. KBP37 features longer sentences and noisier web text, making it a better proxy for real-world applications.

Performance comparison (F1-score) between CNN and RNN models across varying context lengths on Semeval-2010 and KBP37 datasets.

Performance Comparison

On SemEval-2010, the RNN achieved an F1 score of 79.6, outperforming the standard CNN (78.9). On the more difficult KBP37 dataset, the performance gap widened significantly, with the RNN reaching an F1 of 58.8 compared to the CNN's 55.1. Ablation studies further highlighted the importance of the architecture; adding max-pooling to a basic RNN jumped the F1 score from 31.9 to 67.5.

The "Long-Distance" Advantage

Analysis of performance relative to context length (the number of words between entities) reveals that while CNNs and RNNs perform comparably on short contexts, the RNN maintains superior performance as the distance increases. As shown in the experimental results, the CNN's performance tends to degrade more sharply in long-distance scenarios, whereas the RNN's sequential nature allows it to capture dependencies more effectively even as the sentence complexity grows.

Conclusion

This study demonstrates that RNNs, particularly when combined with max-pooling and position indicators, are highly effective for relation classification. The RNN-based approach excels at capturing long-distance patterns that CNNs often miss due to their local window constraints. While performance still dips slightly in extremely long contexts (over 20 words), the use of more advanced units like LSTMs or GRUs could likely further enhance the model's robustness against vanishing gradients in future iterations.

Summary updated

BibTeX
@misc{zhang2015relation,
  author = {Dongxu Zhang and Dong Wang},
  title = {{Relation Classification via Recurrent Neural Network}},
  year = {2015},
  eprint = {1508.01006},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1508.01006},
}
Figure