Domain-Adaptive Text Classification with Structured Knowledge from Unlabeled Data

Tian Li, Xiang Chen, Zhen Dong, Kurt Keutzer, Shanghang Zhang

Introduction

Pre-trained language models (PLMs) like BERT have revolutionized natural language processing, yet they remain remarkably sensitive to "domain shift." A model trained on book reviews may excel at identifying sentiment through words like "compelling" or "readable," but it often falters when applied to electronics, where terms like "rechargeable" or "latency" carry the weight of sentiment. This gap between source and target domains limits the real-world utility of classifiers without expensive, manual re-labeling.

To address this, researchers have introduced DASK (Domain Adaptation with Structured Knowledge). DASK bridges the gap by building a custom knowledge graph from unlabeled target data to link domain-specific concepts to universal "pivot" words, allowing models to generalize effectively across disparate domains.

The DASK Framework

The DASK framework moves beyond traditional pivot-based methods, which often rely on noisy, static word lists. Instead, it employs a two-stage process that leverages the internal "intuition" of language models to map semantic relationships.

1. Knowledge Graph Construction

Rather than relying on external, generic knowledge bases like ConceptNet, DASK constructs a domain-specific Knowledge Graph (KG) using unlabeled text from the target domain. By analyzing BERT’s internal attention matrices, the system identifies strong semantic relationships between words. These are extracted as triplets (e.g., rechargeable — makes — simple), where "simple" acts as a universal pivot and "rechargeable" is the target-specific concept.

2. Knowledge-Injected Finetuning

With the KG established, DASK performs Pivot-induced Cross-domain Knowledge Injection (PCKI). During training on labeled source data, the model injects relevant facts from the target KG into the input text. This creates a tree-structured sentence that explicitly shows the model how source pivots relate to target-domain concepts.

The DASK architecture: Step 1 involves building a KG from unlabeled documents, and Step 2 uses that KG to guide knowledge-injected finetuning.

To process these structures, the authors utilize P-BERT, a variant of K-BERT. P-BERT uses specialized position embeddings and "visibility matrices" to ensure that the model understands the hierarchy of the injected knowledge without introducing noise from unrelated branches of the tree.

Experimental Setup and Datasets

The framework was evaluated across 20 different cross-domain pairs. The primary testing ground was the Amazon Product Review dataset, covering four distinct domains: Books (B), DVD (D), Electronics (E), and Kitchen (K). To test the model's robustness against more "distant" domain shifts, the researchers also utilized the Skytrax Airlines (A) dataset (e.g., training on Airlines and testing on Kitchen reviews).

Results and Analysis

DASK demonstrated superior performance over strong baselines, including BERT-Base, DANN, and HATN, on nearly all tested domain pairs. The authors reported an absolute performance improvement of up to 2.9% over existing methods. On the Amazon dataset, DASK achieved an average accuracy of 90.92%.

Accuracy comparison across various source and target domain pairs, demonstrating DASK's consistency across different shifts.

A key driver of this success is Dynamic Pivot Learning. Unlike older methods that use fixed word lists, DASK maintains a "Memory Bank" that updates word polarity scores during training. This ensures that the pivots remain consistent and discriminative even as the model encounters new data.

Conclusion

DASK represents a significant step forward in domain adaptation by "marrying" structured knowledge with the flexibility of pre-trained language models. By using the model's own attention mechanism to bridge the vocabulary gap between domains, DASK reduces the need for labeled data in new environments. While currently focused on sentiment classification, the framework's ability to extract and inject structured relationships suggests broad potential for other NLP tasks like topic labeling and news classification.

Summary updated

BibTeX
@inproceedings{li2022domain,
  author = {Tian Li and Xiang Chen and Zhen Dong and Kurt Keutzer and Shanghang Zhang},
  title = {{Domain-Adaptive Text Classification with Structured Knowledge from Unlabeled Data}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2022},
  doi = {10.24963/ijcai.2022/585},
}
Figure