Position-aware Joint Entity and Relation Extraction with Attention Mechanism

Chenglong Zhang, Shuyong Gao, Haofen Wang, Wenqiang Zhang

Introduction

Jointly performing Named Entity Recognition (NER) and Relation Extraction (RE) is a cornerstone of modern information extraction. While span-based representations have gained popularity for their ability to handle overlapping entities, they suffer from a significant computational bottleneck: the generation of $O(n^2)$ candidate spans for a sentence of length $n$. This exhaustive approach introduces a massive amount of "negative samples"—spans that do not contain actual entities—which can degrade model performance and increase latency.

This paper introduces PERA (Position-aware Joint Entity and Relation Extraction with Attention Mechanism), a novel framework designed to mitigate these issues. By integrating an attention-based pruning mechanism and position-attentive markers, PERA achieves state-of-the-art (SOTA) performance while drastically reducing the noise inherent in span-based methods.

Methodology

The PERA architecture addresses the limitations of span-based models through two primary innovations: attention-based span pruning and position-aware embeddings.

Architecture of the PERA model showing the attention-based pruning and position-attentive markers.

1. Attention-Based Span Pruning

To filter out irrelevant candidate spans before they reach the classifier, PERA computes a unary "attention score" for every possible span. Spans are ranked by this score, and only the top fraction—defined by a retention factor $\lambda$—is preserved. This early-stage pruning effectively removes up to 95% of negative samples, allowing the model to focus on high-probability entity candidates.

2. Position-Attentive Markers

Spatial context is crucial for both NER and RE. PERA explicitly encodes this by appending special position markers (e.g., [B1][E1]) to the input sequence. The contextual embeddings of these markers are concatenated with standard word embeddings, providing the model with a richer, position-aware representation of each span.

3. Relation Classification Refinement

For relation prediction, the model concatenates the representations of two surviving entities. Notably, the authors found that removing the "span width" embedding during this stage improved performance. This suggests that while width is useful for identifying entity boundaries, it may introduce noise when modeling the semantic relationship between entities.

Experimental Setup

The model was evaluated on three diverse benchmarks:

  • ACE05: A general-domain dataset including news and online forums.
  • CoNLL04: A news-based dataset annotated for entities and relations.
  • SciERC: A domain-specific dataset consisting of AI research paper abstracts.

Key Results and Discussion

PERA established new state-of-the-art benchmarks across all tested datasets, demonstrating the effectiveness of its dual-strategy approach.

Comparison of PERA against state-of-the-art models on ACE05, SciERC, and CoNLL04 datasets.

Performance Gains

Using the ALBERT-xxlarge-v2 encoder, PERA achieved a Relation F1 score of 74.1 on ACE05 (+4.7% over previous SOTA) and a staggering 86.7 on CoNLL04, representing a 17.8% absolute improvement over previous benchmarks. On the SciERC dataset, using SciBERT, it reached an NER F1 of 75.5, a significant 6.6% absolute improvement.

Pruning Efficiency and Synergy

Ablation studies confirmed that the attention-based pruning mechanism is highly efficient. Optimal performance was reached at $\lambda = 0.05$, indicating that the model can discard 95% of candidate spans without sacrificing accuracy. Furthermore, the combination of pruning and position markers proved synergistic: pruning primarily enhances NER by reducing noise, while position markers benefit both NER and RE by providing explicit spatial context.

Conclusion

PERA demonstrates that "less is more" in span-based joint extraction. By intelligently pruning the search space and enriching representations with positional context, the model overcomes the traditional trade-offs between computational efficiency and predictive power. Future work may explore extending this pruning mechanism to document-level extraction, where the candidate span space is even more vast.

Summary updated

BibTeX
@inproceedings{zhang2022position,
  author = {Chenglong Zhang and Shuyong Gao and Haofen Wang and Wenqiang Zhang},
  title = {{Position-aware Joint Entity and Relation Extraction with Attention Mechanism}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2022},
  doi = {10.24963/ijcai.2022/624},
}
Figure