Skip to content

pinae/LSTM-Classification

Repository files navigation

LSTM-Classification

Classify texts with a LSTM implemented in Keras

Installation

Clone this repository:

git clone git@github.com:pinae/LSTM-Classification.git
cd LSTM-Classification

We strongly recommend to use a virtualenv:

python3 -m venv env
source env/bin/activate

Install the dependencies:

pip install wheel
pip install numpy h5py tensorflow-gpu
pip install sacred pymongo

Use tensorflow instead of tensorflow-gpu if you have no GPU with CUDA.

TensorFlow supports Python only to Version 3.7 (info from march 18th). Be aware of that if your system already uses Python 3.8.

Running experiments

To train a LSTM type:

python train_lstm.py

The experiments use Sacred so you can change parameters on the commandline:

python train_lstm.py with embedding_vector_dimensionality=256 LSTM_dropout_factor=0.3 

There are similar experiments for a fully connected network and a simple RNN:

python train_fc.py
python train_simpleRNN.py

About

Classify texts with a LSTM implemented in Keras

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages