Aspect Level Sentiment Classification with Deep Memory Network

Duyu Tang, Bing Qin, Ting Liu

Introduction

Sentiment analysis has traditionally focused on determining the overall polarity of a sentence. However, real-world reviews often contain multiple sentiments directed at different aspects. For instance, in the sentence "The food was great, but the service was dreadful," a single label fails to capture the positive sentiment toward 'food' and the negative sentiment toward 'service'. Aspect-level sentiment classification aims to address this by identifying the sentiment polarity of specific targets within a text.

While Long Short-Term Memory (LSTM) networks have been widely used for this task, they suffer from two main drawbacks: they process information sequentially, making them slow and difficult to parallelize, and they capture context-aspect relationships implicitly. This paper proposes a Deep Memory Network (MemNet) that utilizes an explicit multi-hop attention mechanism over external memory to overcome these limitations.

Methodology: Deep Memory Network

The proposed architecture treats the context words of a sentence as an external memory. Unlike sequential models, the MemNet uses the aspect word as a query to attend to relevant parts of the memory simultaneously.

Architecture of the Deep Memory Network showing the multi-hop attention mechanism over word embeddings.

The model consists of several key components:

  1. External Memory: Context words are converted into embeddings and stored.
  2. Content & Location Attention: The model calculates attention weights based on semantic similarity (content) and the relative distance between context words and the aspect (location).
  3. Multi-hop Computational Layers: The model performs multiple "hops" (iterations), updating its internal state at each step. This allows it to capture complex linguistic patterns like negation or intensification that require multiple passes over the text.
  4. Output Layer: The final representation is passed through a softmax layer for classification into positive, negative, or neutral categories.

Experimental Results

The model was evaluated on the SemEval 2014 Task 4 datasets, specifically the Laptop and Restaurant domains. These benchmarks are standard for testing aspect-level sentiment classification.

Comparison of accuracy between the proposed MemNet (with varying hops) and baseline models.

As shown in the results, the Deep Memory Network consistently outperforms standard LSTMs and attention-based LSTMs (TDLSTM+ATT). Notably, increasing the number of hops generally leads to better performance, with the 7-hop and 9-hop models achieving state-of-the-art results on the Laptop and Restaurant datasets, respectively.

Beyond accuracy, the MemNet offers significant efficiency gains. Due to its non-sequential nature, it is approximately 15 times faster to train on a CPU compared to LSTM-based models. For example, a 9-hop MemNet takes only 29 seconds per epoch on the restaurant dataset, whereas a TDLSTM+ATT model requires 520 seconds.

Discussion and Conclusion

The Deep Memory Network represents a shift from implicit, sequential modeling to explicit, parallelizable attention over memory. By incorporating location information and multiple computational hops, the model effectively identifies relevant context words for specific aspects. While the model excels in accuracy and speed, future work could involve integrating syntactic structures, such as dependency trees, to better handle complex non-compositional expressions and long aspect phrases.

Summary updated

BibTeX
@inproceedings{tang2016aspect,
  author = {Duyu Tang and Bing Qin and Ting Liu},
  title = {{Aspect Level Sentiment Classification with Deep Memory Network}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2016},
  doi = {10.18653/v1/d16-1021},
}
Figure