Replicate, Walk, and Stop on Syntax: An Effective Neural Network Model for Aspect-Level Sentiment Classification

Yaowei Zheng, Richong Zhang, Samuel Mensah, Yongyi Mao

Introduction

Aspect-Level Sentiment Classification (ALSC) is the task of identifying the sentiment polarity (positive, negative, or neutral) toward specific entities or "aspects" mentioned in a sentence. This task is significantly more complex than general sentiment analysis because a single sentence often contains multiple aspects with conflicting sentiments.

Figure 2: An example of aspect-level sentiment classification where a single sentence contains multiple aspects with opposing polarities.

Traditional models, such as LSTMs with standard attention mechanisms, frequently struggle with these nuances. They often become "distracted" by sentiment words associated with other aspects. While syntactic dependency trees offer a potential solution by linking nouns to their specific modifiers, previous methods often simplified these structures or used arbitrary word windows, losing the rich structural information necessary for precise classification.

The RepWalk Model

To address these limitations, we propose RepWalk, a neural network model that treats a sentence's dependency tree as a graph to be traversed. The model performs a "replicated random walk" to effectively ignore irrelevant words and home in on the specific descriptors defining the sentiment for a particular aspect.

1. Syntax Graph Construction

The model converts a standard dependency tree into an "aspect-rooted" graph. A key innovation is the addition of "stop nodes" (represented as triangles in the architecture) to every word node. These represent potential termination points for the sentiment search.

Figure 4: The RepWalk architecture showing the transformation of a dependency tree into an aspect-rooted graph with stop nodes.

2. The Replicated Random Walk

The RepWalk process simulates an agent starting at the aspect term (the root) and navigating the graph through three stages:

  • Replicate: At each node, the agent splits into multiple copies, one for each outgoing branch of the tree.
  • Walk: Each copy moves along an edge with a probability calculated based on word embeddings and the specific type of syntactic relationship (e.g., subject, modifier).
  • Stop: Eventually, a replica reaches a "stop node." The probability of reaching a specific word's stop node becomes that word's "weight" in the final sentiment calculation.

3. Contextual Encoding and Regularization

The model utilizes a Bi-directional Gated Recurrent Unit (Bi-GRU) to create initial word representations, which are then weighted by the RepWalk probabilities. A custom syntactic regularization loss term encourages the model to focus its attention on a small, relevant subtree rather than spreading it across the entire sentence.

Key Results and Insights

RepWalk was evaluated on four standard benchmarks, achieving state-of-the-art results on three of them:

  • Rest14: 83.8% Accuracy
  • Laptop: 78.2% Accuracy
  • Rest16: 89.6% Accuracy

Qualitative case studies demonstrate the model's ability to silence irrelevant subtrees. For instance, in the sentence "The food is good but the service is slow," when focusing on "food," the model assigns high weights to "good" and near-zero weights to "slow."

The Subtree Hypothesis

The success of RepWalk supports the "Subtree Hypothesis": for any given aspect, the essential sentiment information exists within a specific subtree of the dependency tree. By using edge labels as features, the model captures the nuance of how different grammatical relationships convey sentiment.

Limitations and Future Work

The model's primary dependency is the quality of the underlying dependency parser. This was evident in the Twitter dataset results, where the model performed well but did not achieve a new state-of-the-art. Tweets are often ungrammatical or noisy, leading to incorrect dependency trees that misguide the RepWalk agent. Future research will explore learning graph structures dynamically to mitigate reliance on pre-defined syntactic parsers.

Summary updated

BibTeX
@inproceedings{zheng2020replicate,
  author = {Yaowei Zheng and Richong Zhang and Samuel Mensah and Yongyi Mao},
  title = {{Replicate, Walk, and Stop on Syntax: An Effective Neural Network Model for Aspect-Level Sentiment Classification}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2020},
  doi = {10.1609/aaai.v34i05.6517},
}
Figure