Skip to main content

An open-source chat bot program written in Python.

Project description

ChatterBot is a machine-learning based conversational dialog engine build in Python which makes it possible to generate responses based on collections of known conversations. The language independent design of ChatterBot allows it to be trained to speak any language.

Package Version Build Status PyPi Coverage Status

An example of typical input would be something like this:

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

Installation

This package can be installed using

pip install chatterbot

Usage

Create a new chat bot
Note: This object takes an optional parameter for the bot’s name.
from chatterbot import ChatBot
chatbot = ChatBot("Ron Obvious")

Getting a response to input text

response = chatbot.get_response("Good morning!")
print(response)
Specify a default location for conversation log files
Note: The default log directory is conversation_engrams/.
chatbot.log_directory = "path/to/directory/"

Terminal mode (User and chat bot)

from chatterbot import Terminal
terminal = Terminal()
terminal.begin()

Have the chat bot talk with CleverBot

from chatterbot import TalkWithCleverbot
talk = TalkWithCleverbot()
talk.begin()

Social mode (Have the bot respond to users on social media sites)

from chatterbot import SocialBot

log_dir = "path/to/conversation_engrams/"

TWITTER = {
    "CONSUMER_KEY": "<consumer_key>",
    "CONSUMER_SECRET": "<consumer_secret>"
}

chatbot = SocialBot(log_directory=log_dir, twitter=TWITTER)

You will need to generate your own keys for using any API. To use this feature you will need to register your application at Twitter’s developer website to get the token and secret keys.

Use Cases

Using ChatterBot in your app? Let us know! - Salvius (humanoid robot)

Notes

Sample conversations for training the chat bot can be downloaded from https://gist.github.com/gunthercox/6bde8279615b9b638f71

History

See release notes

Project details


Release history Release notifications | RSS feed

This version

0.0.5

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ChatterBot-0.0.5.tar.gz (21.2 kB view details)

Uploaded Source

Built Distribution

ChatterBot-0.0.5-py2.py3-none-any.whl (16.0 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file ChatterBot-0.0.5.tar.gz.

File metadata

  • Download URL: ChatterBot-0.0.5.tar.gz
  • Upload date:
  • Size: 21.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for ChatterBot-0.0.5.tar.gz
Algorithm Hash digest
SHA256 ba047f036b095ca624d38ecfd10afcfc69feaab5d8d618e1f85322e34aa21195
MD5 9c4233a9d1f0cdbdfacb8350885e2ae6
BLAKE2b-256 fc73e7d695e6edf9c52c763507044e7fcbfcd3186afa1987627f5fee561e2ead

See more details on using hashes here.

File details

Details for the file ChatterBot-0.0.5-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for ChatterBot-0.0.5-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 a3e4fa6428026a1f90d4e0ac6878ac280626a7bb0229dfbd8a8e641f1ff81d7e
MD5 9471060c51bd32ef6b235fa3e7b3ac6c
BLAKE2b-256 7dc6c0c58d607c1a583ecfcb4a257bdd9be744b1fd40a0117063840632cd24e2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page