BERTifying the Hidden Markov Model for Multi-Source Weakly Supervised Named Entity Recognition

Yinghao Li, Pranav Shetty, Lucas Liu, Chao Zhang, Le Song

Introduction

Named Entity Recognition (NER) is a fundamental task in Natural Language Processing, yet its success traditionally hinges on large-scale, high-quality human-annotated datasets. In many specialized domains, such as medicine or technical support, obtaining such data is prohibitively expensive. Weak supervision offers a solution by leveraging noisy, heuristic "labeling functions" (e.g., dictionaries, rules, or pre-trained models). However, aggregating these inconsistent and incomplete sources remains a significant challenge.

This paper presents CHMM-ALT, a novel framework that integrates the structured label denoising capabilities of Hidden Markov Models (HMMs) with the deep contextual representations of BERT.

The Challenge of Weak Supervision

Weak labeling sources often suffer from three primary issues: they are incomplete (missing entities), inaccurate (systematic errors), and contradictory (disagreements between sources). Traditional aggregation methods like standard HMMs often fail to capture the semantic context of the tokens being labeled, treating them as independent observations or simple IDs. This lack of context-awareness limits their ability to resolve ambiguities in noisy data.

The CHMM-ALT Framework

The proposed approach introduces two major technical innovations: the Conditional Hidden Markov Model (CHMM) and an iterative "alternate-training" (ALT) loop.

1. Conditional Hidden Markov Model (CHMM)

Unlike a standard HMM where transition and emission probabilities are fixed parameters, the CHMM makes these probabilities dependent on the local context. By utilizing pre-trained BERT embeddings as input to Multi-Layer Perceptrons (MLPs), the model generates token-specific transition and emission matrices. This allows the model to adapt its expectations based on the sentence structure, effectively "seeing" the entire sequence while maintaining the structured benefits of a Markovian approach.

2. Alternate-Training (ALT)

To further refine the labels, the authors implement a two-phase iterative process that allows the aggregator and the classifier to mutually improve.

The CHMM-ALT framework overview, illustrating the two-phase iterative training process.
  • Phase I: The CHMM aggregates weak sources to produce denoised "pseudo-labels," which are then used to train a standard BERT-NER classifier using a Kullback–Leibler divergence (KLD) loss.
  • Phase II: The predictions from the newly trained BERT-NER classifier are fed back into the CHMM as an additional weak source. The CHMM is then retrained, and the cycle repeats. This loop exploits the CHMM's denoising precision and the BERT-NER's ability to generalize beyond the initial weak sources.

Experimental Results

The CHMM-ALT framework was evaluated across four diverse benchmarks: CoNLL 2003 (news), NCBI-Disease (biomedical), BC5CDR (chemical/disease), and LaptopReview (technical).

The results demonstrate that the iterative Phase II training consistently improves performance over the initial Phase I aggregation. On the CoNLL 2003 dataset, for instance, the model shows a clear upward trend in F1 score as the iterations progress, significantly outperforming the strongest baselines.

Performance of CHMM and BERT-NER on the CoNLL 2003 dataset across multiple iterations of Phase II.

Key findings include:

  • State-of-the-Art Performance: CHMM-ALT outperformed strong baselines like BOND and Linked HMM by an average of 4.83 F1 points across the four datasets.
  • Generalization: The model often exceeded the "best possible consensus" (oracle) performance, indicating it learns to identify entities that none of the original weak sources explicitly labeled.
  • Complementarity: Ablation studies confirmed that both the conditional nature of the HMM and the iterative ALT loop are critical for achieving these results.

Conclusion

By "BERTifying" the Hidden Markov Model, the CHMM-ALT framework successfully bridges the gap between structured sequence modeling and modern contextual embeddings. While the iterative approach introduces some computational overhead, the gains in precision and recall make it a powerful tool for NER in low-resource or specialized domains. Future work may involve applying this framework to other sequence labeling tasks like Semantic Role Labeling.

Summary updated

BibTeX
@inproceedings{li2021bertifying,
  author = {Yinghao Li and Pranav Shetty and Lucas Liu and Chao Zhang and Le Song},
  title = {{BERTifying the Hidden Markov Model for Multi-Source Weakly Supervised Named Entity Recognition}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2021},
  doi = {10.18653/v1/2021.acl-long.482},
}
Figure