Abstract
Standard Named Entity Recognition (NER) models often process sentences in isolation, failing to capture document-level label consistency. We introduce DocL-NER, a novel framework that addresses this by combining a Bayesian "drafting" stage with a multi-channel Transformer "refinement" stage. By explicitly modeling non-local dependencies and using uncertainty as a gatekeeper, DocL-NER ensures that identical mentions receive consistent tags throughout a text. Our approach achieves state-of-the-art accuracy on CoNLL2003, OntoNotes, and CHEMDNER datasets, while providing up to a 5.48x speedup over existing document-level models.
The Challenge of Non-Local Dependencies
In standard NER tasks, models typically process sentences in isolation. However, natural language is rarely so fragmented. If the word "Greer" is identified as a Person in the first paragraph of a news article, it is almost certainly a Person when it appears again several paragraphs later.
Existing models, often based on BiLSTMs and Conditional Random Fields (CRFs), excel at capturing local context but struggle with "non-local" dependencies—connections between words far apart in a document. While some recent work has tried to incorporate document-level context, they often fail to explicitly model label consistency. Furthermore, the standard CRF decoding process is sequential and slow, creating a bottleneck for real-time applications.
The DocL-NER Framework
The authors propose a two-stage "Refinement Network" architecture designed to enforce consistency while maintaining efficiency.
Stage 1: Draft and Uncertainty Prediction
The model first uses a Variational LSTM (VLSTM), a type of Bayesian neural network. Instead of just providing a label, the VLSTM performs multiple "passes" using Monte Carlo dropout to estimate uncertainty. It produces "draft labels" and an uncertainty score for every word. If the model is confused about a word, the uncertainty score will be high.
The Key-Value Memory Network
As the model reads the document, it stores every word's hidden state (the "Key") and its predicted draft label embedding (the "Value") in a global memory bank. This acts as a document-wide reference sheet for label consistency.
Stage 2: Multi-Channel Transformer Refinement
A multi-channel Transformer then looks at the draft labels using two attention streams:
- Content Stream: Focuses on the surrounding words (context).
- Label Stream: Queries the memory bank to see how this word (or similar words) was labeled elsewhere in the document.
Crucially, the model only "refines" a label if the Stage 1 uncertainty was above a certain threshold. If the first stage was confident and correct, the model leaves it alone to avoid introducing new errors.
Key Results and Performance
The model was evaluated on three diverse benchmark datasets: CoNLL2003 (news), OntoNotes 5.0 (multi-genre), and CHEMDNER (biomedical). DocL-NER outperformed all previous methods, including BiLSTM-CRF and GraphIE, across all three datasets. On CoNLL2003, it achieved a state-of-the-art F1 score of 92.13.
Beyond accuracy, the model is significantly faster than other document-level models. It achieved a 5.48x speedup in inference compared to "Hier-NER," making it much more viable for production environments. This efficiency stems from replacing sequential CRF decoding with parallel Transformer-based refinement.
Conclusion
DocL-NER demonstrates that document-level consistency is a powerful signal for NER. By treating consistency as a primary feature and using Bayesian uncertainty to gate the refinement process, the model achieves superior accuracy and efficiency. Future work may extend this two-stage refinement approach to other sequence labeling tasks such as Part-of-Speech tagging or slot filling in dialogue systems.
Summary updated