Home
Projects
Resources
Alternatives
Blog
Sign In
Pytorch RNN Text Classification
Save
Word Embedding + LSTM + FC
Overview
Reviews
Resources
Project README
RNN-based short text classification
This is for multi-class short text classification.
Model is built with Word Embedding, LSTM ( or GRU), and Fully-connected layer by
Pytorch
.
A mini-batch is created by 0 padding and processed by using torch.nn.utils.rnn.PackedSequence.
Cross-entropy Loss + Adam optimizer.
Support pretrained word embedding (
GloVe
).
Model
Embedding --> Dropout --> LSTM(GRU) --> Dropout --> FC.
Preprocessing
The following command will download the dataset used in
Learning to Classify Short and Sparse Text & Web with Hidden Topics from Large-scale Data Collections
from
here
and process it for training.
Also it download GloVe embeddings.
python preprocess.py
Training
The following command starts training. Run it with
-h
for optional arguments.
python main.py
Open Source Agenda is not affiliated with "Pytorch RNN Text Classification" Project. README Source:
keishinkickback/Pytorch-RNN-text-classification
Stars
154
Open Issues
1
Last Commit
8 months ago
Repository
keishinkickback/Pytorch-RNN-text-classification
Tags
Glove
Gru
Lstm
Pytorch
Rnn
Text Classification
Word Embedding
Open Source Agenda Badge
Submit Review
Review Your Favorite Project
Submit Resource
Articles, Courses, Videos
Submit Article
Submit a post to our blog
From the blog
Dec 11, 2022
How to Choose Which Programming Language to Learn First?
From the blog
Dec 11, 2022
How to Choose Which Programming Language to Learn First?
Home
Projects
Resources
Alternatives
Blog
Sign In
Sign In to OSA
I agree with
Terms of Service
and
Privacy Policy
Sign In with Github