Clone the repository to your computer and create a virtual environment
$ git clone https://github.com/jjlatval/LSTM_LDA.git $ cd LSTM_LDA $ virtualenv venv $ source venv/bin/activate
In virtualenv run: $ pip install -r requirements.txt
- Adjust n_topics and n_cpu_cores to your liking in topic_modelling.py
- Calculate LDA beta matrix by running calculate_lda.py
- Adjust network parameters (vocabulary_size, hidden_dim, learning_rate & nepoch) in lstm_model.py
- Train network weights by running train_lstm.py
- Generate output text by using the trained network in lstm_output.py
- Run analytics on generated text by running analytics.py
lstm_model gets stuck sometimes in the forward propagation step for an unknown reason