Giter VIP home page Giter VIP logo

seq2seq_chatbot's Introduction

=================================================更新=========================================================== 训练好的模型已经上传到百度云网盘,如果大家有需要可以前去下载。模型训练速度的话,CPU,16G内存,一天即刻训练完成~~~

链接:https://pan.baidu.com/s/1hrNxaSk 密码:d2sn

=================================================分割线,下面是正文===============================================

本文是一个简单的基于seq2seq模型的chatbot对话系统的tensorflow实现。

代码的讲解可以参考我的知乎专栏文章:

从头实现深度学习的对话系统--简单chatbot代码实现

代码参考了DeepQA,在其基础上添加了beam search的功能和attention的机制,

最终的效果如下图所示:

测试效果,根据用户输入回复概率最大的前beam_size个句子:

#使用方法

1,下载代码到本地(data文件夹下已经包含了处理好的数据集,所以无需额外下载数据集)

2,训练模型,将chatbot.py文件第34行的decode参数修改为False,进行训练模型

(之后我会把我这里训练好的模型上传到网上方便大家使用)

3,训练完之后(大概要一天左右的时间,30个epoches),再将decode参数修改为True

就可以进行测试了。输入你想问的话看他回复什么吧==

这里还需要注意的就是要记得修改数据集和最后模型文件的绝对路径,不然可能会报错。

分别在44行,57行,82行三处。好了,接下来就可以愉快的玩耍了~~

seq2seq_chatbot's People

Contributors

lc222 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.