All Projects → yanwii → Dynamic Seq2seq

yanwii / Dynamic Seq2seq

seq2seq中文聊天机器人

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Dynamic Seq2seq

virtual-assistant
Virtual Assistant
Stars: ✭ 67 (-77.89%)
Mutual labels:  chatbot, chatbots
intelligo.js.org
The official website for Intelligo chatbot framework.
Stars: ✭ 18 (-94.06%)
Mutual labels:  chatbot, chatbots
rivescript-java
A RiveScript interpreter for Java. RiveScript is a scripting language for chatterbots.
Stars: ✭ 60 (-80.2%)
Mutual labels:  chatbot, chatbots
chatbot
kbqa task-oriented qa seq2seq ir neo4j jena seq2seq tf chatbot chat
Stars: ✭ 32 (-89.44%)
Mutual labels:  chatbot, seq2seq
chatbot
🤖️ 基于 PyTorch 的任务型聊天机器人(支持私有部署和 docker 部署的 Chatbot)
Stars: ✭ 77 (-74.59%)
Mutual labels:  chatbot, seq2seq
Conversational-AI-Chatbot-using-Practical-Seq2Seq
A simple open domain generative based chatbot based on Recurrent Neural Networks
Stars: ✭ 17 (-94.39%)
Mutual labels:  chatbot, seq2seq
Neural Conversation Models
Tensorflow based Neural Conversation Models
Stars: ✭ 29 (-90.43%)
Mutual labels:  chatbot, seq2seq
Debug seq2seq
[unmaintained] Make seq2seq for keras work
Stars: ✭ 233 (-23.1%)
Mutual labels:  chatbot, seq2seq
intelligo-generator
🛠️ Chatbot generator for Intelligo Framework.
Stars: ✭ 31 (-89.77%)
Mutual labels:  chatbot, chatbots
Bot-Telegram-BeMEAN
💣 Bot para o Telegram do grupo do Be MEAN
Stars: ✭ 76 (-74.92%)
Mutual labels:  chatbot, chatbots
keras-chatbot-web-api
Simple keras chat bot using seq2seq model with Flask serving web
Stars: ✭ 51 (-83.17%)
Mutual labels:  chatbot, seq2seq
Deepqa
My tensorflow implementation of "A neural conversational model", a Deep learning based chatbot
Stars: ✭ 2,811 (+827.72%)
Mutual labels:  chatbot, seq2seq
Chatbot
Python ChatBot 💬
Stars: ✭ 250 (-17.49%)
Mutual labels:  chatbot, chatbots
Seq2seq chatbot links
Links to the implementations of neural conversational models for different frameworks
Stars: ✭ 270 (-10.89%)
Mutual labels:  chatbot, seq2seq
Awesome Bots
The most awesome list about bots ⭐️🤖
Stars: ✭ 2,864 (+845.21%)
Mutual labels:  chatbot, chatbots
Chatbot
A Deep-Learning multi-purpose chatbot made using Python3
Stars: ✭ 36 (-88.12%)
Mutual labels:  chatbot, chatbots
Errbot
Errbot is a chatbot, a daemon that connects to your favorite chat service and bring your tools and some fun into the conversation.
Stars: ✭ 2,605 (+759.74%)
Mutual labels:  chatbot, chatbots
Urban Bot
🤖 The universal chatbot library based on React. Write once, launch Telegram, Facebook, Slack, ... every messenger with chatbots
Stars: ✭ 223 (-26.4%)
Mutual labels:  chatbot, chatbots
pytorch-transformer-chatbot
PyTorch v1.2에서 생긴 Transformer API 를 이용한 간단한 Chitchat 챗봇
Stars: ✭ 44 (-85.48%)
Mutual labels:  chatbot, seq2seq
Chat-Bot
Chatbot – is a computer program that simulates a natural human conversation. Users communicate with a chatbot via the chat interface or by voice, like how they would talk to a real person.
Stars: ✭ 26 (-91.42%)
Mutual labels:  chatbot, chatbots

dynamic-seq2seq

欢迎关注我的另一个项目基于Pytorch以及Beam Search算法的中文聊天机器人

基于中文语料和dynamic_rnn的seq2seq模型


Update:

  • 修复loss计算bug
  • 修复batch_size大于1时的计算bug

Requirements

  • tensorflow-1.4+
  • python2.7 (暂时未对python3 兼容)
  • requests
  • jieba
  • cPickle
  • numpy

谷歌最近开源了一个seq2seq项目 google seq2seq
tensorflow推出了dynamic_rnn替代了原来的bucket,本项目就是基于dynamic_rnn的seq2seq模型。

这里我构建了一些对话预料,中文语料本身就比较稀缺,理论上来说语料越多模型的效果越好,但会遇到很多新的问题,这里就不多作说明。

对话语料分别在data目录下 Q.txt A.txt中,可以替换成你自己的对话语料。


用法:

# 新增小黄鸡语料
# 添加
python prepare_dialog.py 5000


seq = Seq2seq()
# 训练
seq.train()
# 预测
seq.predict("天气")
# 重新训练
seq.retrain()

效果:

me >  天气
AI >  地点: 重庆
气温: 7
注意: 天气较凉,较易发生感冒,请适当增加衣服。体质较弱的朋友尤其应该注意防护。

Action:

本项目添加了Action支持,可以定制自己的功能
后续会加入多轮会话的支持!

在action.py文件中,注册自己action标签及对应的接口,如:

# 注意:参数为固定参数
def act_weather(model, output_str, raw_input):
    #TODO: Get weather by api
    page = requests.get("http://wthrcdn.etouch.cn/weather_mini?city=重庆")
    data = page.json()
    temperature = data['data']['wendu']
    notice = data['data']['ganmao']
    outstrs = "地点: %s\n气温: %s\n注意: %s" % ("重庆", temperature.encode("utf-8"), notice.encode("utf-8"))
    return outstrs


actions = {
    "__Weather__":act_weather
}

Tips: 接口的参数暂时固定,后续更新

同时,训练语料如下设计:

# Q.txt
天气
# A.txt
__Weather__
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].