← all repositories
TobiasLee/Text-Classification

TensorFlow 1.x paper zoo: copy-pasteable attention, RNNs, and a Transformer

A grab-bag of reference implementations for seven text-classification papers, wired to DBpedia and ready for kernel-tweaking.

735 stars Python Language ModelsML Frameworks
Text-Classification
Velocity · 7d
+0.2
★ / day
Trend
steady
star history

What it does

This repo implements seven neural text-classification models in TensorFlow, all trained and evaluated on the DBpedia ontology dataset. You get CNNs, LSTMs with various attention mechanisms, an IndRNN, a Transformer-style multi-head self-attention block, and even an adversarial-training variant. Most modules are borrowed from other GitHub repos and stitched together with training loops.

The interesting bit

The “Attention is All Your Need” implementation treats the whole sentence as Query, Key, and Value simultaneously — a neat simplification of the full Transformer for a single-sequence classification task. The RMDL entry randomly ensembles three deep learners, which feels like bringing a committee to a knife fight.

Key highlights

  • Seven models, one benchmark: everything runs on DBpedia, so you can actually compare numbers.
  • Top reported score is 98.91% from RMDL (needs 2× Tesla Xp); single-model best is 98.5% adversarial Bi-LSTM.
  • Most heavy lifting is done by imported modules (Kyubyong’s multi-head attention, ilivans’s attention wrapper, batzner’s IndRNNCell) — this is more curator than inventor.
  • Updated preprocessing (data_preprocessing_v2) replaces the deprecated VocabularyProcessor with tf.keras.preprocessing.text.
  • Original code targets TensorFlow 1.4; the README notes parameters are “not fine-tuned.”

Caveats

  • Stuck on TensorFlow 1.x; no PyTorch or TF 2.x migration in sight.
  • The adversarial model filename is misspelled (adversrial_abblstm.py) — small, but tells you something about maintenance velocity.
  • HAN underperforms sharply (89.15% vs. 98%+ club); the README doesn’t explain why.

Verdict

Good if you need quick, runnable baselines for classic text-classification papers and don’t mind legacy TensorFlow. Skip if you want modern frameworks, clean abstractions, or production-ready code — this is homework-plus, not library.

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