Giter Site home page Giter Site logo

chatbot-1's Introduction

chatbot

基于深度学习的聊天机器人,使用tensorflow + RNN实现

训练语料

网上公开的语料训练库--小黄鸡语料库,戳我

文件夹介绍

  • data--原始数据以及数据清洗后的字典表,转化为相应的向量输入,enc为encoder的输入,dec为decoder的输入
  • result--测试集的问答效果,为对话形式

代码介绍

  • data_utils.py--数据清洗,将数据分为问句和答句
  • prepareData.py--生成字典表,转化为数字向量,将中文输入转化为向量输入
  • seq2seq_model.py--定义seq2seq模型,初始化函数,定义类
  • execute.py--执行函数,定义训练部分,测试部分
  • train.py--训练函数
  • predict.py--测试函数,定义测试集的测试
  • seq2seq.ini--配置函数,定义一些训练的参数
  • getConfig.py--获取配置函数的方法

训练环境

windows 10 python 3.6.1 tensorflow==1.2.1

聊天效果图

Image text

Image text

result测试内容

ask: 我还喜欢她,怎么办
answer: 我要努力了,我也知道

ask: 什么意思
answer: 不想哄哄的,主人有什么我很喜欢。。。。

ask: 你相公是谁
answer: 当然是美丽的主人咯

ask: 有
answer: 啊…我只有你……

ask: 看来,你是自动回复的
answer: 嗯

chatbot-1's People

Contributors

lianghaixing avatar

Watchers

 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.