Introduction
Effective text representation is a cornerstone of Natural Language Processing (NLP). Traditional approaches like Bag-of-Words often fail to capture semantic nuances because they ignore word order. While Recurrent Neural Networks (RNNs) and Convolutional Neural Networks (CNNs) have addressed some of these issues, they each possess inherent limitations. RNNs often suffer from "recency bias," where later words dominate the representation, while CNNs struggle with long-range dependencies and require extensive hyperparameter tuning for window sizes. This paper introduces the RCNN-HW model, a hybrid architecture designed to combine the strengths of both while mitigating their weaknesses through the use of highway layers.
The RCNN-HW Architecture
The proposed model integrates a bidirectional recurrent structure with a convolutional layer, bridged by "highway layers" that act as adaptive feature selectors.
The pipeline consists of three primary stages:
- Bi-Recurrent Layer: Utilizing a Bidirectional Gated Recurrent Unit (Bi-GRU), the model scans text in both directions to capture the left and right context for every word in the sequence.
- Highway Layer: Positioned between the recurrent and convolutional stages, the highway layer employs a gating mechanism. This allows the model to selectively transform or pass through features, effectively filtering the dense contextual information provided by the Bi-RNN to highlight the most relevant semantic signals.
- Convolutional & Max-Pooling Layer: A CNN with a window size of 1 processes these filtered features. Since the Bi-RNN has already encoded the global context, a larger window is unnecessary, reducing parameter complexity. Finally, a max-pooling layer extracts the most salient features across the entire document to form the final classification vector.
Experimental Results
The model was evaluated on the IMDB sentiment analysis dataset, consisting of 25,000 movie reviews. This dataset is particularly challenging due to the high variance in review length, making it an ideal test for long-text representation.
The RCNN-HW model achieved a state-of-the-art accuracy of 0.903, outperforming standard CNNs (0.895), LSTMs (0.885), and the original RCNN without highway layers (0.900).
A key finding is the model's robustness to sequence length. As shown in the figure above, RCNN-HW demonstrates a superior scaling property; its accuracy improves significantly as the sequence length increases to 500 words, outperforming both pure recurrent and pure convolutional architectures in handling long-form text. This suggests the model is particularly adept at managing complex structures like double negatives found in longer reviews.
Conclusion
By combining the sequential modeling of RNNs with the feature extraction of CNNs and the adaptive gating of highway layers, RCNN-HW provides a powerful framework for text classification. The inclusion of highway layers specifically allows for better feature selection, leading to improved performance on long, complex documents where traditional models might struggle. Future work could involve applying this architecture to broader NLP tasks and incorporating pre-trained embeddings to further enhance performance.
Summary updated