← all repositories
gaussic/text-classification-cnn-rnn

Teaching 2014-era CNNs to classify Chinese news

A hands-on reference port of classic CNN and RNN sentence classifiers to Chinese text, from corpus plumbing to confusion matrix.

4.3k stars Python ML FrameworksLanguage Models
text-classification-cnn-rnn
Not currently ranked — collecting fresh signals.
star history

What it does This repo implements two old-school neural approaches—a shallow Conv1D CNN and a two-layer GRU/LSTM RNN—to sort Chinese news into ten categories. It works at the character level, using a fixed-length sequence of 600 character IDs, and trains on a 50,000-sample slice of the THUCNews corpus.

The interesting bit The project is essentially a faithful translation of seminal 2014–2015 English text-classification papers to Chinese, but the real value lies in the boring parts it refuses to hide: vocabulary serialization, fixed-length padding, batch shuffling, and per-class F1 reporting. In an era of one-line transformers pipelines, this is a useful anatomy lesson.

Key highlights

  • Character-level models for Chinese, avoiding English-style word tokenization.
  • CNN achieves 96.04% test accuracy after just three epochs on the 10-class dataset.
  • Includes preprocessing scripts (cnews_loader.py) and helpers to carve the THUCNews subset.
  • Emits per-class precision, recall, and a full confusion matrix rather than a single top-line score.
  • Uses tf.nn.conv1d instead of the more common 2D convolution workaround for text.

Caveats

  • Targets TensorFlow 1.3+ and supports Python 2, so the code uses the graph-and-session APIs of a bygone era.
  • The README truncates during RNN training logs and never publishes final RNN test metrics, leaving its performance relative to the CNN unclear.
  • You must download the THUCNews subset manually; it is not bundled in the repository.

Verdict Worth a look if you are learning how classical deep-learning text classification works under the hood or need a baseline for Chinese news. If you want a modern, production-ready classifier, this is a museum piece.

Frequently asked

What is gaussic/text-classification-cnn-rnn?
A hands-on reference port of classic CNN and RNN sentence classifiers to Chinese text, from corpus plumbing to confusion matrix.
Is text-classification-cnn-rnn open source?
Yes — gaussic/text-classification-cnn-rnn is open source, released under the MIT license.
What language is text-classification-cnn-rnn written in?
gaussic/text-classification-cnn-rnn is primarily written in Python.
How popular is text-classification-cnn-rnn?
gaussic/text-classification-cnn-rnn has 4.3k stars on GitHub.
Where can I find text-classification-cnn-rnn?
gaussic/text-classification-cnn-rnn is on GitHub at https://github.com/gaussic/text-classification-cnn-rnn.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.