Domain adaptation for sequence labeling using hidden Markov models

Edouard Grave, Guillaume Obozinski, Francis R. BacharXiv 2013 · OpenReview

Abstract

Most natural language processing systems based on machine learning are not robust to domain shift. For example, a state-of-the-art syntactic dependency parser trained on Wall Street Journal sentences has an absolute drop in performance of more than ten points when tested on textual data from the Web. An efficient solution to make these methods more robust to domain shift is to first learn a word representation using large amounts of unlabeled data from both domains, and then use this representation as features in a supervised learning algorithm. In this paper, we propose to use hidden Markov models to learn word representations for part-of-speech tagging. In particular, we study the influence of using data from the source, the target or both domains to learn the representation and the different ways to represent words using an HMM.

Introduction

Machine learning models for Natural Language Processing (NLP) often suffer from brittleness when applied to domains outside their training set. A part-of-speech (POS) tagger trained on the Wall Street Journal (WSJ) may achieve 97% accuracy on news but drop significantly when applied to web text or specialized scientific literature. This performance degradation is primarily driven by domain shift, largely caused by out-of-vocabulary (OOV) words. For instance, financial news models lack the specialized vocabulary of biomedical research or the idiosyncratic abbreviations found on Twitter. Since manual labeling for every new domain is expensive, domain adaptation techniques that leverage unlabeled data are essential.

Methodology

The authors propose a two-step pipeline for domain adaptation:

  1. Unsupervised Representation Learning: A Hidden Markov Model (HMM) is trained on large volumes of unlabeled text from source and target domains. Computational efficiency is achieved using an online Expectation-Maximization (EM) algorithm and approximate message passing, allowing the training of models with hundreds of latent classes on tens of millions of sequences in a single day.
  2. Supervised Sequence Labeling: The latent states of the HMM serve as features for a Conditional Random Field (CRF) trained on a small amount of labeled source-domain data.

Four methods for extracting HMM features were evaluated:

  • VITERBI: The single most likely latent class for a word.
  • POSTERIOR-TOKEN: The probability distribution over latent classes for a word in its specific context.
  • POSTERIOR-TYPE: The average probability distribution for a word type across the entire unlabeled corpus.
  • POSTERIOR-BOTH: A concatenation of Token and Type features.

Results and Discussion

The HMM-based features provided substantial improvements over the baseline CRF (trained only on word types). In the biomedical domain, accuracy rose from a baseline of 84.6% to 92.9% using the "POSTERIOR-BOTH" method. In the Twitter domain, the improvement was even more dramatic, moving from 62.4% to 72.4%.

Comparison of HMM feature extraction methods and unlabeled data sources.

As shown in the table above, using the full posterior distribution (soft assignments) consistently outperforms Viterbi decoding (hard assignments). Furthermore, the best results were achieved when the HMM was trained on unlabeled data specifically from the target domain. The "POSTERIOR-BOTH" approach proved most effective because it captures both local context (Token) and global word behavior (Type), which is particularly beneficial for OOV words.

The study also examined the impact of adding small amounts of labeled target-domain data to the training process.

Accuracy as a function of the number of labeled sentences from the target domain.

As illustrated in the learning curves, while adding labeled target data improves performance, the relative benefit of source-domain labeled data diminishes as more target-domain data becomes available. This is especially evident in highly divergent domains like Twitter, where the "target only" approach eventually matches or exceeds the "target & source" approach as the sample size increases.

Conclusion

This research demonstrates that unsupervised HMM representations are a powerful tool for domain adaptation in sequence labeling. By leveraging large-scale unlabeled data from the target domain and using soft posterior distributions as features, models can overcome the challenges of domain shift and OOV words. Future work may explore optimal weighting schemes for mixing source and target data and extending this approach to other tasks like named entity recognition or syntactic parsing.

Summary updated

Abstract

Most natural language processing systems based on machine learning are not robust to domain shift. For example, a state-of-the-art syntactic dependency parser trained on Wall Street Journal sentences has an absolute drop in performance of more than ten points when tested on textual data from the Web. An efficient solution to make these methods more robust to domain shift is to first learn a word representation using large amounts of unlabeled data from both domains, and then use this representation as features in a supervised learning algorithm. In this paper, we propose to use hidden Markov models to learn word representations for part-of-speech tagging. In particular, we study the influence of using data from the source, the target or both domains to learn the representation and the different ways to represent words using an HMM.
BibTeX
@misc{grave2013domain,
  author = {Edouard Grave and Guillaume Obozinski and Francis R. Bach},
  title = {{Domain adaptation for sequence labeling using hidden Markov models}},
  year = {2013},
  eprint = {1312.4092},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1312.4092},
}
Figure