Abstract
Relation extraction (RE) is a fundamental task in natural language processing aimed at identifying semantic relationships between entities. Traditional deep learning approaches like CNNs and RNNs often struggle with preserving spatial information and handling multiple overlapping relations within a single sentence. This paper proposes a novel neural architecture that integrates Bi-LSTMs with capsule networks and dynamic routing. By treating feature aggregation as a routing problem, the model effectively captures complex linguistic structures and supports multi-label, multi-entity relation extraction. Experimental results on the NYT and Wikidata datasets demonstrate that the proposed model outperforms state-of-the-art baselines, particularly in complex multi-relation scenarios.
Introduction
Relation extraction (RE) involves identifying semantic relationships between entities in text, such as extracting the [founder_of] relation from the sentence "Steve Jobs started Apple." While deep learning models like CNNs and RNNs have achieved significant success in RE, they face two primary limitations:
- Loss of spatial information: Standard pooling operations (max or average) compress sentences into fixed-size vectors, discarding structural and spatial relationships between words.
- Single-relation bottleneck: Most systems are optimized to predict a single relation for a single entity pair, whereas real-world sentences often contain multiple interleaved entities and overlapping relations.
To address these gaps, this research adapts Capsule Networks—originally developed for computer vision—to NLP, enabling dynamic information routing to handle multi-label, multi-entity scenarios natively.
Methodology
The proposed model utilizes a Multi-Instance Multi-Label (MIML) learning framework consisting of several key components:
- Input Representation: Words are mapped to embeddings and concatenated with relative position embeddings to track distances to target entities.
- Bi-LSTM with Word-Level Attention: A Bi-LSTM captures semantic context, while a word-level attention mechanism weighs outputs to focus on relation-relevant keywords.
- Primary Capsule Layer: Instead of scalar neurons, the model uses capsules (neuron groups outputting vectors). A sliding 2-gram window over Bi-LSTM outputs generates these "Primary Capsules."
- Dynamic Routing: This core innovation replaces max-pooling with an iterative "routing-by-agreement" algorithm. Primary capsules dynamically determine the information flow to higher-level "Relation Capsules."
- Prediction: The length of each Relation Capsule's vector represents the probability of a specific relation. This allows the model to predict multiple relations simultaneously.
Experimental Results
The model was evaluated on two standard distant-supervision benchmarks: the NYT Dataset (for single entity pair extraction) and the Wikidata Dataset (for multiple entity pairs).
The proposed model achieved an Area Under the Curve (AUC) of 0.397 on the NYT dataset, outperforming strong baselines like Rank+ExATT (0.395) and PCNN+ATT (0.323). Its strength was even more evident on the Wikidata dataset, where it achieved an AUC of 0.405, surpassing PCNN+ATT(1) and Rank+ExATT.
Hyperparameter Analysis
- Routing Iterations: The best results were achieved with 3 iterations. Excessive iterations can force capsules to link to only one upper capsule, which harms multi-relation performance.
- Capsule Dimension: A dimension of 8 provided the optimal balance between accuracy and computational efficiency.
Discussion and Insights
The success of the model highlights several key insights:
- Routing vs. Pooling: Dynamic routing preserves the "geometry" of a sentence better than max-pooling, which is crucial for parsing complex grammatical structures.
- Native Multi-Relation Capability: By using individual capsules for each relation, the model avoids the need to force-rank a single "best" relation, allowing for more natural multi-label classification.
- Synergy with Attention: Ablation studies show that word-level attention provides cleaner inputs for the routing algorithm, significantly boosting overall performance.
Conclusion
While the model demonstrates state-of-the-art performance, it faces challenges with assignment ambiguity when a single entity pair holds multiple distinct relations. Additionally, capsule networks are more computationally intensive than standard architectures. Future work will focus on incorporating prior knowledge (e.g., entity types) and joint training with Named Entity Recognition (NER) to resolve complex assignments.
Summary updated