GitPedia

TextClassificationBenchmark

A Benchmark of Text Classification in PyTorch

From FreedomIntelligence·Updated March 31, 2026·View on GitHub·

We are trying to build a Benchmark for Text Classification including The project is written primarily in Python, distributed under the MIT License license, first published in 2017. Key topics include: attention-is-all-you-need, benchmark, capusle, cnn, cnn-classification.

Text Classification Benchmark

A Benchmark of Text Classification in PyTorch

Motivation

We are trying to build a Benchmark for Text Classification including

Many Text Classification DataSet, including Sentiment/Topic Classfication, popular language(e.g. English and Chinese). Meanwhile, a basic word embedding is provided.

Implment many popular and state-of-art Models, especially in deep neural network.

Have done

We have done some dataset and models

Dataset done

  • IMDB
  • SST
  • Trec

Models done

  • FastText
  • BasicCNN (KimCNN,MultiLayerCNN, Multi-perspective CNN)
  • InceptionCNN
  • LSTM (BILSTM, StackLSTM)
  • LSTM with Attention (Self Attention / Quantum Attention)
  • Hybrids between CNN and RNN (RCNN, C-LSTM)
  • Transformer - Attention is all you need
  • ConS2S
  • Capsule
  • Quantum-inspired NN

Libary

You should have install these librarys

<pre> python3 torch torchtext (optional) </pre>

Dataset

Dataset will be automatically configured in current path, or download manually your data in Dataset, step-by step.

including

<pre> Glove embeding Sentiment classfication dataset IMDB </pre>

usage

Run in default setting

<pre><code>python main.py</code></pre>

CNN

<pre><code>python main.py --model cnn</code></pre>

LSTM

<pre><code>python main.py --model lstm</code></pre>

Road Map

  • Data preprossing framework
  • Models modules
  • Loss, Estimator and hyper-paramter tuning.
  • Test modules
  • More Dataset
  • More models

Organisation of the repository

The core of this repository is models and dataset.

  • dataloader/: loading all dataset such as IMDB, SST

  • models/: creating all models such as FastText, LSTM,CNN,Capsule,QuantumCNN ,Multi-Head Attention

  • opts.py: Parameter and config info.

  • utils.py: tools.

  • dataHelper: data helper

Contributor

Welcome your issues and contribution!!!

Contributors

Showing top 5 contributors by commit count.

View all contributors on GitHub →

This article is auto-generated from FreedomIntelligence/TextClassificationBenchmark via the GitHub API.Last fetched: 6/24/2026