Aspect-based Sentiment Analysis with Context Denoising

Yuanhe Tian, Chang Liu, Yan Song, Fei Xia, Yongdong ZhangNAACL 2024

Abstract

Given a sentence and a particular aspect term, aspect-based sentiment analysis (ABSA) aims to predict the sentiment polarity towards this aspect term, which provides fine-grained analysis on sentiment understanding and it has attracted much attention in recent years. In order to achieve a good performance on ABSA, it is important for a model to appropriately encode contextual information, especially identifying salient features and eliminating noise in the context. To make incorrect predictions, most existing approaches employ powerful text encoders to locate important context features, as well as noises that mislead ABSA models. These approaches determine the noise in the text for ABSA by assigning low weights to context features or directly removing them from model input, which runs the risk of computing wrong weights or eliminating important context information. In this paper, we propose to improve ABSA with context denoising, where three types of word-level information are regarded as noise, namely, lexicographic noise, bag-of-words noise, and syntax noise. We utilize diffusion networks to perform the denoising process to gradually eliminate them so as to better predict sentiment polarities for given aspect terms. Our approach uses task-specific noise rather than the standard stochastic Gaussian noise in the diffusion networks. The experimental results on five widely used ABSA datasets demonstrate the validity and effectiveness of our approach.

What Problem Does This Paper Address?

In Aspect-based Sentiment Analysis (ABSA), the goal is to determine the sentiment toward a specific "aspect" in a sentence. For example, in the sentence "The environment is OK but the bar service is terrible," the sentiment for "environment" is positive, while "bar service" is negative.

Example of noise in ABSA: 'terrible' is informative for 'bar service' but acts as noise for 'Environment'.

The challenge is that words like "terrible" are highly informative for one aspect but act as noise for another. If a model focuses on the wrong words, it makes a mistake. Existing methods try to solve this by assigning low weights to unimportant words (attention mechanisms) or deleting them entirely. However, calculating these weights is error-prone, and deleting words can strip away vital context. The authors argue that we need a more robust way to "denoise" the context specifically for the aspect being analyzed.

Methods

The authors propose a framework called ASA-CD (Aspect-based Sentiment Analysis with Context Denoising). The core innovation is the use of Diffusion Networks—usually used for image generation—repurposed to perform context denoising with task-specific linguistic noise.

Task-Specific Noise Extraction

Instead of using standard random Gaussian noise common in image diffusion, they identify three types of linguistic noise to ground the model in the specific task:

  • Lexicographic Noise: Common stop words (e.g., "is", "the", "but").
  • Bag-of-Words Noise: Words physically distant from the aspect term in the sentence.
  • Syntax Noise: Words that are distant from the aspect term in a dependency tree (linguistic structure).
Three strategies for task-specific noise extraction: Lexicographic, Bag-of-Words, and Syntactic.

The Diffusion Process

  1. Input Encoding: Powerful pre-trained models like BERT or LLaMA-2 create initial representations of the sentence and the aspect.
  2. Forward (Noising): They gradually "corrupt" the input representation by adding the embeddings of these identified noise words.
  3. Backward (Denoising): A Transformer-based decoder learns to reverse this process, gradually stripping away the influence of the noise words to recover a "clean" representation that focuses only on the features relevant to the specific aspect.
  4. Final Prediction: The denoised representation is combined with the original sentence and aspect features to predict the final sentiment (Positive, Negative, or Neutral).

Key Insights and Results

  • Linguistic Noise > Gaussian Noise: The most significant finding is that diffusion models work better for NLP when the noise is grounded in the task. By using actual "distractor" words from the sentence as noise, the model learns exactly what to ignore.
  • Syntax is King: Among the three noise types, Syntax Noise (based on dependency trees) performed the best. This suggests that the structural relationship between words is a better indicator of relevance than simple physical distance.
  • State-of-the-Art Performance: The LLaMA-7B + CD (Syntax Noise) configuration achieved the highest scores across almost all datasets, notably reaching 81.02 F1 on LAP14 and 86.13 F1 on MAMS (a dataset where every sentence contains multiple aspects with different polarities).
  • Robustness: Even when using smaller encoders (BERT-base), the context denoising approach provided a significant boost, proving that the benefit comes from the denoising architecture itself, not just the size of the underlying language model.

Limitations and Future Work

  • Dependency on Parsers: The best-performing version of the model relies on an external dependency parser. If the parser makes a mistake, the noise extraction will be flawed, potentially hurting the model.
  • Computational Overhead: Diffusion models are iterative, requiring multiple passes (60 steps provided the optimal balance in this study) to reach a prediction. This is more computationally expensive than standard classifiers.
  • Future Directions: The authors suggest exploring ways to integrate diffusion networks into other tasks that require distinguishing between essential and non-essential content, such as document summarization or evidence extraction.

Summary updated

BibTeX
@inproceedings{tian2024aspect,
  author = {Yuanhe Tian and Chang Liu and Yan Song and Fei Xia and Yongdong Zhang},
  title = {{Aspect-based Sentiment Analysis with Context Denoising}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2024},
  url = {https://openreview.net/forum?id=H7nbzlSQ5w},
}
Figure