=================================================Update ================================================== ========= The trained model has been uploaded to Baidu Cloud Network Disk. If you need it, you can download it. In terms of model training speed, with CPU and 16G memory, training can be completed in one day~~~
Link: https://pan.baidu.com/s/1hrNxaSk Password: d2sn
================================================= Division line, below is the text =============================================== ==
This article is a simple tensorflow implementation of a chatbot dialogue system based on the seq2seq model.
For the explanation of the code, you can refer to my Zhihu column:
Implementing a deep learning dialogue system from scratch - simple chatbot code implementation
The code refers to DeepQA, on which the beam search function and attention mechanism are added.
The final effect is shown below:
Test the effect, based on the user's input of the top beam_size sentences with the highest probability of reply:
#How to use
1. Download the code locally (the data folder already contains the processed data set, so there is no need to download additional data sets)
2. To train the model, change the decode parameter in line 34 of the chatbot.py file to False to train the model.
(I will upload the model I trained here later to the Internet for everyone to use)
3. After training (it will take about a day, 30 epochs), change the decode parameter to True.
It’s time to test. Enter what you want to ask and see what he replies==
Another thing to note here is to remember to modify the absolute paths of the data set and the final model file, otherwise an error may be reported.
They are in three places: line 44, line 57, and line 82. Okay, now you can have fun~~