NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Joint Learning of Local and Global Features for Aspect-based Sentiment Classification

Hao Niu, Yun Xiong, Xiaosu Wang, Philip S. YuarXiv 2023 · OpenReview

Abstract

Aspect-based sentiment classification (ASC) aims to judge the sentiment polarity conveyed by the given aspect term in a sentence. The sentiment polarity is not only determined by the local context but also related to the words far away from the given aspect term. Most recent efforts related to the attention-based models can not sufficiently distinguish which words they should pay more attention to in some cases. Meanwhile, graph-based models are coming into ASC to encode syntactic dependency tree information. But these models do not fully leverage syntactic dependency trees as they neglect to incorporate dependency relation tag information into representation learning effectively. In this paper, we address these problems by effectively modeling the local and global features. Firstly, we design a local encoder containing: a Gaussian mask layer and a covariance self-attention layer. The Gaussian mask layer tends to adjust the receptive field around aspect terms adaptively to deemphasize the effects of unrelated words and pay more attention to local information. The covariance self-attention layer can distinguish the attention weights of different words more obviously. Furthermore, we propose a dual-level graph attention network as a global encoder by fully employing dependency tag information to capture long-distance information effectively. Our model achieves state-of-the-art performance on both SemEval 2014 and Twitter datasets.

Introduction

Aspect-based Sentiment Classification (ASC) is a fine-grained task where a model must predict the sentiment polarity (positive, negative, or neutral) for specific "aspect terms" within a sentence. For example, in the sentence "The food was great but the service was dreadful," the model must identify "food" as positive and "service" as negative.

The authors identify three major hurdles in current ASC research:

  1. The Local-Global Tension: Sentiment is often found near the aspect, but crucial context can also be far away. Existing models often struggle to balance these two.
  2. Attention "Blurriness": Standard self-attention mechanisms often fail to sufficiently distinguish between important and irrelevant words, leading to "mushy" attention weights.
  3. Underutilized Syntax: While graph-based models use dependency trees to find long-distance connections, they often ignore the type of relationship (the dependency tags like nsubj or dobj), which carries vital semantic information.

To address these, the authors propose GDD (Gaussian mask Distinguishable and Dual-level attention structure), a novel framework that combines an adaptive Gaussian mask for local context with a dual-level graph attention network for global syntactic relationships.

Methods

The GDD model consists of two specialized encoders that process the output of a pre-trained BERT layer.

The overall architecture of the GDD model, featuring Local and Global Encoders.

1. The Local Encoder

  • Gaussian Mask Layer: Instead of using a fixed window of words around an aspect, this layer learns to adjust its "receptive field" adaptively. It calculates a standard deviation ($\sigma$) for each sentence, allowing the model to focus on a narrow or wide local context as needed.
  • Covariance Self-Attention: To solve the "blurriness" problem, the authors modify standard self-attention by subtracting the mean query and key embeddings. This amplifies the differences between word pairs, making the attention scores more "distinguishable."

2. The Global Encoder

  • Aspect-word Interactive Graph (AWIG): The authors build a graph where the aspect term is the central node, directly connected to context words via one-hop or multi-hop paths in a dependency tree.
  • Dual-level Graph Attention Network (DGAT): This is the "global" engine. It uses a two-stage attention mechanism: first, it attends to the edges (the dependency tags) to understand the relationship type, and then it attends to the nodes (the words). This ensures that the nature of the connection (e.g., a subject vs. an object) informs the sentiment.

Experimental Results

The model was evaluated on three standard benchmark datasets: SemEval 2014 Task 4 (Restaurant and Laptop) and a Twitter dataset.

Comparison of GDD performance against state-of-the-art models on benchmark datasets.

The GDD model outperformed several strong baselines, including BERT-RGAT and LCFS-ASC-CDW.

  • Accuracy: Achieved 87.50% on Restaurant, 81.74% on Laptop, and 76.34% on Twitter.
  • Ablation Studies: Removing the Gaussian mask caused a significant drop in performance (e.g., from 87.50% to 85.98% on the Restaurant set), proving that adaptive local focus is a key driver of the model's success.
  • Qualitative Visualization: Heatmaps show that GDD correctly identifies "distinguishable" words like "disappointed" or "complained" in complex sentences where previous models failed.

Conclusion

The GDD framework effectively captures both near-field and long-distance sentiment cues by jointly learning local and global features. By utilizing adaptive receptive fields and incorporating dependency tag information, the model achieves state-of-the-art results. Future work may address the computational complexity of constructing dependency graphs and the reliance on external parsers.

Summary updated

BibTeX
@misc{niu2023joint,
  author = {Hao Niu and Yun Xiong and Xiaosu Wang and Philip S. Yu},
  title = {{Joint Learning of Local and Global Features for Aspect-based Sentiment Classification}},
  year = {2023},
  eprint = {2311.01030},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2311.01030},
}
Figure