Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Text classification models implemented in Keras, including: FastText, TextCNN, TextRNN, TextBiRNN, TextAttBiRNN, HAN, RCNN, RCNNVariant, etc.
| Date | Stars |
|---|---|
| 2026-07-24 | 812 |
| 2026-07-25 | 812 |
| 2026-07-28 | 812 |
| 2026-07-30 | 812 |
| 2026-08-06 | 812 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
# TextClassification-Keras
This code repository implements a variety of **deep learning models** for **text classification** using the **Keras** framework, which includes: **FastText**, **TextCNN**, **TextRNN**, **TextBiRNN**, **TextAttBiRNN**, **HAN**, **RCNN**, **RCNNVariant**, etc. In addition to the model implementation, a simplified application is included.
- [English documents](README.md)
- [中文文档](README-ZH.md)
## Guidance
1. [Environment](#environment)
2. [Usage](#usage)
3. [Model](#model)
1. [FastText](#1-fasttext)
2. [TextCNN](#2-textcnn)
3. [TextRNN](#3-textrnn)
4. [TextBiRNN](#4-textbirnn)
5. [TextAttBiRNN](#5-textattbirnn)
6. [HAN](#6-han)
7. [RCNN](#7-rcnn)
8. [RCNNVariant](#8-rcnnvariant)
999. [To Be Continued...](#to-be-continued)
4. [Reference](#reference)
## Environment
- Python 3.7
- NumPy 1.17.2
- Tensorflow 2.0.1
## Usage
All codes are located in the directory ```/model```, and each kind of model has a corresponding directory in which the model and application are placed.
For example, the model and application of FastText are located under ```/model/FastText```, the model part is ```fast_text.py```, and the application part is ```main.py```.
## Model
### 1 FastText
FastText was proposed in the paper [Bag of Tricks for Efficient Text Classification](https://arxiv.org/pdf/1607.01759.pdf).
#### 1.1 Description in Paper
<p align="center">
<img src="image/FastText.png">
</p>
1. Using a look-up table, **bags of ngram** covert to **word representations**.
2. Word representations are **averaged** into a text representation, which is a hidden variable.
3. Text representation is in turn fed to a **linear classifier**.
4. Use the **softmax** function to compute the probability distribution over the predefined classes.
#### 1.2 Implementation Here
Network structure of FastText:
<p align="center">
<img src="image/FastText_network_structure.png">
</p>
### 2 TextCNN
TextCNN was proposed in the paper [Convolutional Neural Networks for Sentence Classification](http://www.aclweb.org/anthology/D14-1181).
#### 2.1 Description in Paper
<p align="center">
<img src="image/TextCNN.png">
</p>
1. Represent sentence with **static and non-static channels**.
2. **Convolve** with multiple filter widths and feature maps.
3. Use **max-over-time pooling**.
4. Use **fully connected layer** with **dropout** and **softmax** ouput.
#### 2.2 Implementation Here
Network structure of TextCNN:
<p align="center">
<img src="image/TextCNN_network_structure.png">
</p>
### 3 TextRNN
TextRNN has been mentioned in the paper [Recurrent Neural Network for Text Classification with Multi-Task Learning](https://www.ijcai.org/Proceedings/16/Papers/408.pdf).
#### 3.1 Description in Paper
<p align="center">
<img src="image/TextRNN.png">
</p>
#### 3.2 Implementation Here
Network structure of TextRNN:
<p align="center">
<img src="image/TextRNN_network_structure.png">
</p>
### 4 TextBiRNN
TextBiRNN is an improved model based on TextRNN. It improves the RNN layer in the network structure into a bidirectional RNN layer. It is hoped that not only the forward encoding information but also the reverse encoding information can be considered. No related papers have been found yet.
Network structure of TextBiRNN:
<p align="center">
<img src="image/TextBiRNN_network_structure.png">
</p>
### 5 TextAttBiRNN
TextAttBiRNN is an improved model which introduces attention mechanism based on TextBiRNN. For the representation vectors obtained by bidirectional RNN encoder, the model can focus on the information most relevant to decision making through the attention mechanism. The attention mechanism was first proposed in the paper [Neural Machine Translation by Jointly Learning to Align and Translate](https://arxiv.org/pdf/1409.0473.pdf), and the implementation of the attention mechanism here is referred to this paper [Feed-Forward Networks with Attention Can Solve Some Long-Term Memory Problems](https:Excerpt of 9,607 characters
Read on GitHub26
1
Would you bet a product on this? Bounded 0–100 and slow moving.
matched fp:b940b02d03de09e4, topic:nlp, topic:text-classification, desc:text classification