Giter Site home page Giter Site logo

chinese-chatbot's Introduction

Chinese-ChatBot/中文聊天机器人

环境配置

程序 版本
python 3.68
Keras
windows10
jupyter

关键点

  • LSTM
  • seq2seq
  • attention 实验表明加入attention机制后训练速度快,收敛快,效果更好。

语料及训练环境

青云语料库10万组对话,在google colaboratory训练。

运行

完整过程

  • 数据预处理
    get_data
  • 模型训练
    chatbot_train(此为挂载到google colab版本,本地跑对路径等需略加修改)
  • 模型预测
    chatbot_inference_Attention

加载现有模型

  • 运行chatbot_inference_Attention
  • 加载models/W--184-0.5949-.h5

界面(Tkinter)

Attention权重可视化

其他

  • 训练文件chat_bot中,最后三块代码前两个是挂载谷歌云盘用的,最后一个是获取那些loss方便画图,不知道为什么回调函数里的tensorbord不好使,故出此下策;
  • 预测文件里倒数第二块代码只有文字输入没界面,最后一块代码是界面,根据需求两块跑其一即刻;
  • 代码中有很多中间输出,希望对你理解代码提供了些许帮助;
  • models里面有一个我训练好的模型,正常运行应该是没有问题的,你也可以自己训练
  • 本人能力有限,并未找到量化对话效果的指标,因此loss只能大致反映训练进度。
  • 未完待续。

chinese-chatbot's People

Contributors

jayeew 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.