1 Star 0 Fork 34

stamhe / QQChatBot

forked from airgzn / QQChatBot 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
bot_api.py 526 Bytes
一键复制 编辑 原始数据 按行查看 历史
airgzn 提交于 2017-03-26 20:13 . Upload start.sh bot_api.py ai.py
#!/usr/bin/env python
# coding: utf-8
from chatterbot import ChatBot
from chatterbot.trainers import ChatterBotCorpusTrainer
import hug
deepThought = ChatBot("deepThought", read_only=True)
# deepThought = ChatBot("deepThought")
# 开启自动学习
deepThought.set_trainer(ChatterBotCorpusTrainer)
# 使用中文语料库训练它
deepThought.train("chatterbot.corpus.chinese")
# 语料库
@hug.get()
def get_response(user_input):
response = deepThought.get_response(user_input).text
return {"response":response}
Python
1
https://gitee.com/stamhe/QQChatBot.git
git@gitee.com:stamhe/QQChatBot.git
stamhe
QQChatBot
QQChatBot
master

搜索帮助