cinarteker / mogrifier-lstm

Tensorflow Implementation of Mogrifier LSTM.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mogrifier-LSTM

This is a Tensorflow Implementation of Mogrifier LSTM. To train the model on the Fraser short jokes dataset, first download the dataset and process it by sub-word tokens via

python process_fraser_jokes_subword.py

followed by

python train_fraser_jokes_sw_tf_ver2_lstm.py

to train the model. After training the model, run

python infer_fraser_jokes_sw_tf_ver2_lstm.py

to perform inference.

The model can also be trained on the movie dialog dataset. Prior to training the mode, first download the data, then run the script

python process_movie_dialog_subword.py

to process the corpus into its sub-word tokens. To train the model on the sub-word vocabulary, run

python train_movie_dialog_sw_tf_ver2_lstm.py

followed by

python infer_movie_dialog_sw_tf_ver2_lstm.py

to perform inference.

Some examples of the inferred response of the trained model are:

Enter input phrase: what time is it?

Input Phrase:
what time is it?
Generated Response:
SOS seven - thirty . EOS
--------------------------------------------------
Enter input phrase: how much does it cost?

Input Phrase:
how much does it cost?
Generated Response:
SOS two hundred dollars . EOS
--------------------------------------------------
Enter input phrase: where are we going?

Input Phrase:
where are we going?
Generated Response:
SOS to the hotel . to register . EOS
--------------------------------------------------

About

Tensorflow Implementation of Mogrifier LSTM.


Languages

Language:Python 100.0%