ChatterBot Python 聊天机器人框架

程序名称:ChatterBot

授权协议: BSD

操作系统: 跨平台

开发语言: Python

ChatterBot 介绍

chatterbot一个 Python 库,用于简化聊天机器人的开发。chatterbot 使用不同的机器学习算法来生成不同的响应内容

示例对话:

user: Good morning! How are you doing?
bot:  I am doing very well, thank you for asking.
user: You're welcome.
bot:  Do you like hats?

处理流程:

示例代码

# -*- coding: utf-8 -*-
from chatterbot import chatbot
import logging


# Uncomment the following line to enable verbose logging
# logging.basicConfig(level=logging.INFO)

# Create a new instance of a chatbot
bot = chatbot("Terminal",
    storage_adapter="chatterbot.storage.JsonFileStorageAdapter",
    logic_adapters=[
        "chatterbot.logic.MathematicalEvaluation",
        "chatterbot.logic.TimeLogicAdapter",
        "chatterbot.logic.BestMatch"
    ],
    input_adapter="chatterbot.input.TerminalAdapter",
    output_adapter="chatterbot.output.TerminalAdapter",
    database="../database.db"
)

print("Type something to begin...")

# The following loop will execute each time the user enters input
while True:
    try:
        # We pass None to this method because the parameter
        # is not used by the TerminalAdapter
        bot_input = bot.get_response(None)

    # Press ctrl-c or ctrl-d on the keyboard to exit
    except (KeyboardInterrupt, EOFError, SystemExit):
        break

ChatterBot 官网

https://github.com/gunthercox/ChatterBot

相关编程语言

memcached-session-manager 将session存储到memchac...
Tomcat Native 这个项目可以让 Tomcat 使用 Apache ...
EasyTomcat 是一个用来帮助简化 Tomcat 和MySQL 管理...
riak-session-manager 是使用 Riak 来存储Tomcat se...
tomcat-redis-session-manager 是一个用来将 Tomcat...
这是一款在 Oracle 的 JDeveloper 开发环境下管理To...