A Global Context Mechanism for Sequence Labeling

Conglei Xu, Kun Shen, Hongguang Sun, Yang Xu
5/31/2023
7 citations
cs.CL
transformer-attention

Official code: conglei2XU/Global-Context-Mechanism (20 stars, Python, MIT, last commit 2025-06-25).

Abstract

Global sentence information is crucial for sequence labeling tasks, where each word in a sentence must be assigned a label. While BiLSTM models are widely used, they often fail to capture sufficient global context for inner words.

Show full abstract

Previous work has proposed various RNN variants to integrate global sentence information into word representations. However, these approaches suffer from three key limitations: (1) they are slower in both inference and training compared to the original BiLSTM, (2) they cannot effectively supplement global information for transformer-based models, and (3) the high time cost associated with reimplementing and integrating these customized RNNs into existing architectures. In this study, we introduce a simple yet effective mechanism that addresses these limitations. Our approach efficiently supplements global sentence information for both BiLSTM and transformer-based models, with minimal degradation in inference and training speed, and is easily pluggable into current architectures. We demonstrate significant improvements in F1 scores across seven popular benchmarks, including Named Entity Recognition (NER) tasks such as Conll2003, Wnut2017 , and the Chinese named-entity recognition task Weibo, as well as End-to-End Aspect-Based Sentiment Analysis (E2E-ABSA) benchmarks such as Laptop14, Restaurant14, Restaurant15, and Restaurant16. With out any extra strategy, we achieve third highest score on weibo NER benchmark. Compared to CRF, one of the most popular frameworks for sequence labeling, our mechanism achieves competitive F1 scores while offering superior inference and training speed. Code is available at: https://github.com/conglei2XU/Global-Context-Mechanism

View on arXivView PDF

Code Implementations(1)

MIT

Supplementary Features of BiLSTM for Enhanced Sequence Labeling

202Python, ShellMay 22, 20231 years agoMIT

Similar Papers

Cite this paper

@article{xu2023global,
  title  = {A Global Context Mechanism for Sequence Labeling},
  author = {Conglei Xu and Kun Shen and Hongguang Sun and Yang Xu},
  year   = {2023},
  eprint = {2305.19928},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2305.19928v6}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2305.19928.svg)](https://codeofpaper.com/paper/2305.19928)

Discussion