Code for reproducing main results in the paper A Neural Conversational Model to build a conversational chat bot using seq2seq model.
This model extends seq2seq with these features:
- Reinforcment learning for more coherent dialouge instead of 1-to-1 relpy.
- Buckets while training to limit memory consumption
- Beam search to avoid local minima resopnses (needs to be optimized)
- Anti-langauge moddel to supress global solutions like "Thanks, ok" when uncertain.
- python 3.5
- TensorFlow 1.0 version
- asyncio
- websockets
chmod +x setup
./setup
-
The format should be one txt file with input on a line followed by the response on the next line.
Datasets/ | |-Your-dataset/ | |-data/raw/ |- chat.txt twitter Twitter chat by [Marsan](https://github.com/Marsan-Ma/chat_corpus)
-
Optional: to get trained model, download and extract:
-
To train Seq2Seq run
seq2seq_train
passing model namepython seq2seq_train.py --model_name twitter and pass in params
-
To evaluate Seq2Seq run
seq2seq_eval
passing model namepython seq2seq_eval.py --model_name twitter and pass in params
-
Or simply run ./twitter_chat which will download the trained model and start the chatting interface. This model wasn't trained with reinforcment learning as the chat dataset is not dialouge.
./twitter_chat
- Make sure
rosbridge_websocket
(port 9090) is running on the ROS master - In order to start the ROS node and service for answer generation call
./advertise_gnlp_service
- Call a service
rosservice call /roboy/cognition/generative_nlp/answer "text_input: 'hello'"
[1] Sequence to Sequence Learning with Neural Networks [2] A Neural Conversational Model