Introduction
Document-level sentiment classification, such as determining the polarity of a long movie or restaurant review, presents a significant challenge in natural language processing. Unlike sentence-level analysis, document-level tasks must account for the complex compositionality of multiple sentences. Traditional methods, like Support Vector Machines (SVMs) using bag-of-ngrams, often fail to capture the sequential and logical flow between sentences. This paper proposes a hierarchical neural network architecture designed to model documents from the bottom up, effectively capturing inter-sentence relations to improve sentiment prediction.
Methodology: Hierarchical Document Modeling
The proposed architecture consists of two primary stages: sentence composition and document composition.
- Sentence Composition: The model first transforms a sequence of word embeddings into a fixed-length sentence vector. Two approaches were evaluated: a Convolutional Neural Network (CNN) using multiple filter widths to capture local n-gram features, and a Long Short-Term Memory (LSTM) network for sequential processing.
- Document Composition: This core innovation involves feeding sentence vectors into a Gated Recurrent Neural Network (GRNN). Unlike standard RNNs, which suffer from the vanishing gradient problem in long sequences, the GRNN utilizes update and reset gates to adaptively manage information flow across the document.
- Classification: The final document representation is passed through a Softmax layer to predict sentiment labels.
Experimental Setup
The model was evaluated on four large-scale, real-world datasets:
- Yelp Dataset Challenge (2013, 2014, 2015): Restaurant reviews with 5-star ratings. The 2015 dataset includes over 1.5 million documents.
- IMDB: Movie reviews with a 10-star rating scale.
These datasets provide a rigorous test for the model's ability to handle long-range dependencies and complex discourse structures.
Results and Discussion
The proposed models, Conv-GRNN and LSTM-GRNN, consistently outperformed state-of-the-art baselines across all datasets.
Key findings include:
- The Necessity of Gating: Standard RNNs performed poorly on document modeling. The introduction of gating mechanisms led to a substantial increase in accuracy, particularly on the IMDB dataset where accuracy jumped from 34.4% (Recurrent Avg) to 43.0% (GatedNN).
- Superiority over Traditional Baselines: On the Yelp 2015 dataset, the LSTM-GRNN achieved 67.6% accuracy, significantly outperforming the SVM+Bigrams baseline of 62.4%.
- Improved Error Profiles: The models showed lower Mean Squared Error (MSE), indicating that incorrect predictions were typically closer to the true rating than those of baseline models.
- Capturing Sentiment Shifters: By modeling the sequence of sentences, the GRNN can recognize discourse structures like "but" or "however" that shift the overall polarity of a review.
Conclusion and Future Work
The hierarchical GRNN approach demonstrates the importance of modeling documents as sequences of semantic units. While effective, future work could involve explicitly incorporating discourse relations using external parsers or exploring tree-structured composition to better reflect non-linear document structures. Additionally, the computational cost of training these gated models on massive datasets remains a practical consideration.
Summary updated