Recurrent Convolutional Neural Networks for Text Classification

Siwei Lai, Liheng Xu, Kang Liu, Jun Zhao

Abstract

Traditional text classification models often struggle with capturing long-range context while remaining computationally efficient. This paper introduces the Recurrent Convolutional Neural Network (RCNN), a model that integrates the sequential modeling strengths of Recurrent Neural Networks (RNNs) with the feature-selection capabilities of Convolutional Neural Networks (CNNs). By employing a bi-directional recurrent structure and a max-pooling layer, the RCNN captures broad context and identifies key features with linear time complexity, outperforming traditional window-based and tree-based architectures.

Introduction

Text classification is a fundamental task in Natural Language Processing (NLP). However, existing methods often face limitations in balancing context capture with efficiency:

  1. Bag-of-Words (BoW) and N-grams: These models often neglect word order and suffer from data sparsity when attempting to capture long-distance dependencies.
  2. Recursive Neural Networks (RecursiveNN): While effective at capturing semantics through tree structures, they are computationally expensive ($O(n^2)$) and depend on high-quality parse trees.
  3. Recurrent Neural Networks (RNN): These capture sequential information in $O(n)$ time but are inherently biased, giving more weight to later words, which can be problematic if key information appears early in a document.
  4. Convolutional Neural Networks (CNN): These are fast and unbiased but rely on fixed window sizes. Small windows lose long-range context, while large windows significantly increase the parameter space.

The RCNN aims to be unbiased, capture long-range context, and maintain computational efficiency.

The RCNN Architecture

The RCNN architecture consists of three primary stages designed to create a "flexible window" for context capture.

The RCNN architecture featuring bi-directional recurrent layers and a max-pooling layer.
  1. Recurrent Contextual Layer: Instead of a fixed window, the model utilizes a bi-directional recurrent structure to define a word's context. It computes a "left context" vector (representing all preceding words) and a "right context" vector (representing all succeeding words).
  2. Word Representation: For each word, the model concatenates its left context, its own embedding, and its right context. This contextualized embedding is transformed via a linear layer and a $tanh$ activation to produce a latent semantic vector.
  3. Max-Pooling Layer: After generating latent vectors for every word, a max-pooling layer selects the maximum value across each dimension. This "convolutional" step identifies the most important features regardless of their position in the text, effectively eliminating the bias found in standard RNNs.

Experimental Evaluation

The authors evaluated the RCNN on four diverse datasets:

  • 20Newsgroups: Long English news articles across 4 topics.
  • Fudan Set: Very long Chinese documents across 20 classes.
  • ACL Anthology Network: Short scientific metadata.
  • Stanford Sentiment Treebank (SST): Very short movie reviews with 5 sentiment labels.

The model was trained using Stochastic Gradient Descent (SGD) with word vectors initialized via pre-trained Skip-gram (word2vec) embeddings.

Results and Discussion

The RCNN consistently matched or exceeded state-of-the-art performance across all tested datasets.

Performance comparison of RCNN against various baseline models across four datasets.

Key Findings

  • Superior Performance: On the 20Newsgroups dataset, RCNN achieved a 96.49% Macro-F1 score, outperforming standard CNNs (94.79%) and traditional BoW+SVM approaches (92.43%).
  • Error Reduction: Compared to the best baselines, RCNN reduced error rates by 33% on 20Newsgroups and 19% on the Fudan set.
  • Robustness to Context: While CNN performance varies significantly with window size, RCNN consistently outperforms even the best-tuned CNN configurations.
  • Semantic Disambiguation: The recurrent structure allows the model to resolve ambiguities. For instance, the word "Bank" is correctly identified as a geographical location when the model "sees" the surrounding context "stroll along the South Bank."

Conclusion

The RCNN provides a powerful framework for text classification by combining the best aspects of RNNs and CNNs. While it shows exceptional results on document-level tasks, it was slightly outperformed by Paragraph-Vector models on very short sentence tasks like SST (47.21% vs 48.70%). Future work may involve extending this architecture to tasks like information retrieval or integrating explicit syntactic dependencies for more complex grammatical structures.

Summary updated

BibTeX
@inproceedings{lai2015recurrent,
  author = {Siwei Lai and Liheng Xu and Kang Liu and Jun Zhao},
  title = {{Recurrent Convolutional Neural Networks for Text Classification}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2015},
  doi = {10.1609/aaai.v29i1.9513},
}
Figure