Target-Dependent Sentiment Classification with Long Short Term Memory

Duyu Tang, Bing Qin, Xiaocheng Feng, Ting Liu

Abstract

Target-dependent sentiment classification remains a challenge: modeling the semantic relatedness of a target with its context words in a sentence. Different context words have different influences on determining the sentiment polarity of a sentence towards the target. Therefore, it is desirable to integrate the connections between target word and context words when building a learning system. In this paper, we develop two target dependent long short-term memory (LSTM) models, where target information is automatically taken into account. We evaluate our methods on a benchmark dataset from Twitter. Empirical results show that modeling sentence representation with standard LSTM does not perform well. Incorporating target information into LSTM can significantly boost the classification accuracy. The target-dependent LSTM models achieve state-of-the-art performances without using syntactic parser or external sentiment lexicons.

Introduction

Most sentiment analysis models perform "sentence-level" classification, assigning a single polarity (positive, negative, or neutral) to an entire string of text. However, real-world language is rarely that simple. Consider the sentence: "I bought a new camera. The picture quality is amazing but the battery life is too short."

A standard model might get confused by the mix of "amazing" and "too short." More importantly, the sentiment changes depending on your target: it’s positive for "picture quality" but negative for "battery life." This is the core of target-dependent sentiment classification. The challenge lies in modeling the semantic relationship between a specific target word and its surrounding context, recognizing that different context words matter more or less depending on what target you are evaluating.

Proposed Models

Standard LSTMs are often "target-blind" because they generate the same sentence representation regardless of the target being evaluated. To address this, we propose two extensions:

TD-LSTM (Target-Dependent LSTM)

This model uses two LSTMs to "sandwich" the target. One LSTM processes the preceding context plus the target (left-to-right), and another processes the following context plus the target (right-to-left). The final hidden states of both are concatenated to represent the sentence-target pair.

Architectural comparison between standard LSTM and Target-Dependent LSTM (TD-LSTM).

TC-LSTM (Target-Connection LSTM)

TC-LSTM goes a step further by capturing the interaction between the target and each context word more deeply. At every single time step, the input to the LSTM is the concatenation of the current word embedding and a target vector (the average of the target's word embeddings). This forces the model to "look at" the target while processing every single word in the sentence.

Experimental Setup

The models were evaluated on a benchmark Twitter dataset originally introduced by Dong et al. (2014). The dataset contains 6,248 training instances and 692 test instances. Each instance is a tweet with a manually labeled sentiment (Positive, Negative, or Neutral) towards a specific target mention. The distribution is roughly 25% positive, 25% negative, and 50% neutral.

Results and Discussion

The empirical results confirmed that a standard LSTM performs poorly on this task because it cannot distinguish between different targets in the same sentence. In contrast, the proposed models set a new bar for performance.

Performance comparison of various models on the Twitter sentiment classification benchmark.

As shown in the results, TC-LSTM achieved the best performance with 71.5% accuracy. Crucially, it outperformed feature-heavy Support Vector Machines (SVMs) and complex Recursive Neural Networks (AdaRNN) that require dependency parsing.

Key insights from the experiments include:

  • The "Constant Reminder" Strategy: TC-LSTM’s success suggests that explicitly feeding the target information into every hidden state update is more effective than just including the target at the end of a sequence.
  • Embeddings Matter: 100-dimensional GloVe vectors pre-trained on Twitter data were found to be the most effective, outperforming sentiment-specific embeddings (SSWE) in this architecture.
  • Simplicity vs. Complexity: Interestingly, more complex "Attention-based" LSTMs performed worse (around 65% accuracy), likely due to the small size of the dataset which led to overfitting.

Conclusion

Incorporating target information into LSTM architectures significantly boosts classification accuracy for target-dependent sentiment analysis. While the models performed well, a case study revealed that 85.4% of errors involved the "neutral" category, which remains the hardest to classify in short, noisy text like tweets. Future work may involve incorporating external sentiment lexicons into the TC-LSTM framework to provide a further accuracy boost.

Summary updated

BibTeX
@inproceedings{tang2016target,
  author = {Duyu Tang and Bing Qin and Xiaocheng Feng and Ting Liu},
  title = {{Target-Dependent Sentiment Classification with Long Short Term Memory}},
  booktitle = {International Conference on Computational Linguistics},
  year = {2016},
}
Figure