DomBERT: Domain-oriented Language Model for Aspect-based Sentiment Analysis

Hu Xu, Bing Liu, Lei Shu, Philip S. Yu · DOI

TL;DR

This paper introduces DomBERT, a novel extension of BERT designed to improve aspect-based sentiment analysis (ABSA) in low-resource domains. By leveraging both in-domain and related "neighboring" domains, DomBERT effectively learns domain-specific language understanding, outperforming existing methods on ABSA tasks.

What Problem Does This Paper Address?

Pre-trained language models like BERT have revolutionized NLP by learning general language understanding from massive, mixed-domain datasets. However, for specialized tasks like Aspect-Based Sentiment Analysis (ABSA), which requires nuanced understanding of specific domains (e.g., electronics, restaurants), general models often fall short. This is because their training data may not adequately cover the long-tailed or underrepresented aspects within a particular domain. While domain-specific models can capture these nuances, they often suffer from limited training data. This paper addresses this gap by proposing a method to effectively combine the strengths of both general and domain-specific language models, particularly in low-resource scenarios.

Methods

The core innovation is DomBERT, an extension of BERT that incorporates domain-oriented learning. This approach aims to learn language models that are attuned to a specific target domain by also drawing knowledge from related "source" domains.

Key components of DomBERT include:

  • Domain Classification: An auxiliary task is introduced to learn embeddings for each domain. This is achieved by training a classifier that predicts the domain of a given text snippet. The learned domain embeddings capture the relationships between different domains.
  • Domain Sampler: Based on the learned domain embeddings, a sampler dynamically selects training examples. It uses cosine similarity between the target domain and other domains to create a probability distribution for sampling. This ensures that examples from the target domain are prioritized, but also incorporates relevant examples from similar domains, effectively enriching the training data.
  • Unified Loss Function: The training objective combines three components:
  • Masked Language Modeling (MLM): The standard BERT pre-training task.
  • Domain Classification Loss: To learn domain embeddings.
  • Regularizer: To encourage diversity among domain embeddings, promoting better separation and understanding of distinct domains.

DomBERT also adopts some successful strategies from prior work, such as dynamic masking and removing the next sentence prediction (NSP) task, which were found to be beneficial for pre-training.

Datasets

The paper focuses on Aspect-Based Sentiment Analysis (ABSA) tasks and utilizes the following datasets:

  • SemEval Datasets: Specifically, SemEval 2014 Task 4 (Laptop) and SemEval 2016 Task 5 (Restaurant) for aspect extraction (AE) and aspect sentiment classification (ASC).
  • Amazon Review Datasets and Yelp Dataset: Large-scale, unlabeled corpora from these sources are used to simulate low-resource settings for the target domains (Laptop and Restaurant). For source domains, reviews from other categories on Amazon and Yelp (excluding Laptop and Restaurant) are used.

The paper emphasizes the "low-resource" aspect by selecting approximately 100 MB of data for the target domains, contrasting with the much larger corpora used by some baseline methods.

Key Insights and Ideas

  • "Neighboring" Domains are Crucial: The paper strongly suggests that for specialized tasks, learning from domains that are related to the target domain (even if not identical) is significantly more beneficial than relying solely on a massive, mixed-domain corpus. This is because related domains share a substantial amount of contextual and linguistic knowledge relevant to the target.
  • Domain Embeddings as a Bridge: The learned domain embeddings act as a sophisticated mechanism to quantify domain similarity. This allows the model to intelligently select and integrate knowledge from relevant sources, rather than treating all domains equally or indiscriminately.
  • Low-Resource ABSA is Feasible: DomBERT demonstrates that even with limited in-domain data, competitive or superior performance can be achieved by strategically leveraging external, related domain data. This has significant implications for applying NLP models to niche areas where large annotated datasets are scarce.
  • End-to-End ABSA Benefits Most: The results show that DomBERT's domain-oriented approach yields the most significant improvements on end-to-end ABSA tasks. This is attributed to the fact that E2E-ABSA is inherently more domain-specific, requiring a deeper understanding of both aspects and their associated sentiments within a particular context.

Key Results

DomBERT consistently outperforms baseline models, including vanilla BERT, BERT-Review (BERT post-trained on mixed-domain reviews), and BERT-DK (BERT trained on domain-specific corpus only), across various ABSA tasks:

  • Aspect Extraction (AE): DomBERT achieves the highest F1 scores for both Laptop (83.89%) and Restaurant (77.21%), outperforming BERT-DK which used a larger restaurant corpus.
  • Aspect Sentiment Classification (ASC): While BERT-Review shows slightly better accuracy on Laptop, DomBERT performs competitively and is strong on Restaurant (83.14% MF1).
  • End-to-End ABSA (E2E-ABSA): DomBERT shows the most significant gains here, achieving the best Precision, Recall, and F1 scores for both Laptop (66.21% F1) and Restaurant (73.45% F1). This highlights its ability to capture the combined domain-specific knowledge required for this task.

Limitations and Future Work

  • Domain Tag Availability: The paper assumes that domain tags are largely available online without requiring extra supervised annotation. The effectiveness of DomBERT relies on this assumption for its domain classification and sampling mechanisms.
  • Computational Cost: While DomBERT is presented as an extension, the multi-task learning and domain sampling process likely adds to the overall training time and computational resources required compared to standard BERT fine-tuning.
  • Future Work: The authors suggest that DomBERT's approach of exploiting relevant domains can be extended to other NLP tasks beyond ABSA, particularly those that benefit from domain-specific knowledge. Further exploration into more sophisticated methods for domain similarity discovery and sampling could also be beneficial.

Summary updated

BibTeX
@inproceedings{xu2020dombert,
  author = {Hu Xu and Bing Liu and Lei Shu and Philip S. Yu},
  title = {{DomBERT: Domain-oriented Language Model for Aspect-based Sentiment Analysis}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2020},
  doi = {10.18653/v1/2020.findings-emnlp.156},
}
Figure