← Open Source
ShawnyXiao

TextClassification-Keras

Text classification models implemented in Keras, including: FastText, TextCNN, TextRNN, TextBiRNN, TextAttBiRNN, HAN, RCNN, RCNNVariant, etc.

TutorialsML/AI fundamentalsPython
Open on GitHub
Momentum
+0stars in 24 hours0.0%
812
Stars
185
Forks
+0
This week
2
Contributors
Created 2019-01-03 · Updated 2026-08-21 · #13566 today
Top developers
ShawnyXiao

ShawnyXiao/TextClassification-Keras is ranked 13,566 with 812 stars.

Same-category comparison

ShawnyXiao/TextClassification-Keras is ranked 13,566 among these 8 peers; PracticalDL/Practical-Deep-Learning-Book is ranked 13,564.

Same-category comparison
NameRankMetrics
UMich-CURLY-teaching/UMich-ROB-530-public13,538
Language:
HTML
Stars:
814
Forks:
145
Description:
UMich 500-Level Mobile Robotics Course.
altdeep/causalAI13,539
Language:
Jupyter Notebook
Stars:
814
Forks:
218
Description:
The open source repository for the Causal Modeling in Machine Learning Workshop at Altdeep.ai @ www.altdeep.ai/courses/causalAI.
awslabs/amazon-bedrock-agent-samples13,554
Language:
Python
Stars:
813
Forks:
283
Description:
Example Jupyter notebooks 📓 and code scripts 💻 for using Amazon Bedrock Agents 🤖 and its functionalities.
PracticalDL/Practical-Deep-Learning-Book13,564
Language:
Jupyter Notebook
Stars:
812
Forks:
339
Description:
Official code repo for the O'Reilly Book - Practical Deep Learning for Cloud, Mobile & Edge.
GoogleCloudPlatform/keras-idiomatic-programmer13,578
Language:
Jupyter Notebook
Stars:
811
Forks:
277
Description:
Books, Presentations, Workshops, Notebook Labs, and Model Zoo for Software Engineers and Data Scientists wanting to learn the TF.Keras Machine Learning framework.
cyrusbehr/tensorrt-cpp-api13,581
Language:
C++
Stars:
811
Forks:
105
Description:
TensorRT C++ API Tutorial.
erikaduan/r_tips13,589
Language:
R
Stars:
810
Forks:
205
Description:
R programming tips for data cleaning, data visualisation, statistical modelling and machine learning.
unpingco/Python-for-Probability-Statistics-and-Machine-Learning13,604
Language:
Jupyter Notebook
Stars:
809
Forks:
300
Description:
Jupyter Notebooks for Springer book "Python for Probability, Statistics, and Machine Learning".
Key parameters and specifications
Key parameters and specifications
ParameterValue
LanguagePython
CategoryTutorials
SubcategoryML/AI fundamentals
Stars812
Forks185
Contributors2
Created date2019-01-03
Updated date2026-08-21
Stars in 1 day0
Stars in 7 days0
Rank13,566
Previous rank13,457
Rank change-109
7-day stars rank14,003
Previous 7-day stars rank14,022
7-day stars rank change19
Total stars rank13,178
Previous total stars rank13,158
Total stars rank change-20
CountryChina
README summary

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. 1 Usage All codes are located in the directory , 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 , the model

part is , and the application part is . Model 1 FastText FastText was proposed in the paper Bag of Tricks for Efficient Text Classification. Using a look-up table, **bags of ngram** covert to **word representations**. Word representations are **averaged** into a text representation, which is a hidden variable. Text representation is in turn fed to a **linear classifier**. Use the **softmax** function to compute the probability distribution over the predefined classes. 2 Implementation Here Network structure of FastText: 2 TextCNN

TextCNN was proposed in the paper Convolutional Neural Networks for Sentence Classification. Represent sentence with **static and non-static channels**. **Convolve** with multiple filter widths and feature maps. Use **fully connected layer** with **dropout** and **softmax** ouput. 2 Implementation Here Network structure of TextCNN: 3 TextRNN TextRNN has been mentioned in the paper Recurrent Neural Network for Text Classification with Multi-Task Learning. 2 Implementation Here Network structure of TextRNN: 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. Network structure of TextBiRNN: 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, 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. 1 Description in Paper In the paper Feed-Forward Networks with Attention Can Solve Some Long-Term Memory Problems, the **feed forward attention** is simplified as follows, Function , a learnable function, is recognized as a **feed forward network**. In this

formulation, attention can be seen as producing a fixed-length embedding of the input sequence by computing an **adaptive weighted average** of the state sequence . 2 Implementation Here The implementation of attention is not described here, please refer to the source code directly. Network structure of TextAttBiRNN: 6 HAN HAN was proposed in the paper Hierarchical Attention Networks for Document Classification. Encoding by **bidirectional GRU**, an annotation for a given word is obtained by concatenating the forward hidden state and

backward hidden state, which summarizes the information of the whole sentence centered around word in current time step. By a

Frequently asked questions

How many stars and forks are recorded?

ShawnyXiao/TextClassification-Keras has 812 stars and 185 forks.

What is the repository rank?

ShawnyXiao/TextClassification-Keras is ranked 13,566.

What language and category are recorded?

ShawnyXiao/TextClassification-Keras has 812 stars, uses Python and belongs to Tutorials.

Which repository is closest in rank?

ShawnyXiao/TextClassification-Keras is compared with PracticalDL/Practical-Deep-Learning-Book, ranked 13,564 with 812 stars.

Nearby in the ranking
Similar items