![ChatterBot: Machine learning in Python](https://i.imgur.com/b3SCmGT.png)
# ChatterBot
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](https://img.shields.io/pypi/v/chatterbot.svg)](https://pypi.python.org/pypi/chatterbot/)
[![Python 3.6](https://img.shields.io/badge/python-3.6-blue.svg)](https://www.python.org/downloads/release/python-360/)
[![Django 2.0](https://img.shields.io/badge/Django-2.0-blue.svg)](https://docs.djangoproject.com/en/2.1/releases/2.0/)
[![Requirements Status](https://requires.io/github/gunthercox/ChatterBot/requirements.svg?branch=master)](https://requires.io/github/gunthercox/ChatterBot/requirements/?branch=master)
[![Build Status](https://travis-ci.org/gunthercox/ChatterBot.svg?branch=master)](https://travis-ci.org/gunthercox/ChatterBot)
[![Documentation Status](https://readthedocs.org/projects/chatterbot/badge/?version=stable)](http://chatterbot.readthedocs.io/en/stable/?badge=stable)
[![Coverage Status](https://img.shields.io/coveralls/gunthercox/ChatterBot.svg)](https://coveralls.io/r/gunthercox/ChatterBot)
[![Code Climate](https://codeclimate.com/github/gunthercox/ChatterBot/badges/gpa.svg)](https://codeclimate.com/github/gunthercox/ChatterBot)
[![Join the chat at https://gitter.im/chatterbot/Lobby](https://badges.gitter.im/chatterbot/Lobby.svg)](https://gitter.im/chatterbot/Lobby?utm_source=badge&utm_medium=badge&utm_content=badge)
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:** You're welcome.
> **bot:** Do you like hats?
## How it works
An untrained instance of ChatterBot starts off with no knowledge of how to communicate. Each time a user enters a statement, the library saves the text that they entered and the text that the statement was in response to. As ChatterBot receives more input the number of responses that it can reply and the accuracy of each response in relation to the input statement increase. The program selects the closest matching response by searching for the closest matching known statement that matches the input, it then returns the most likely response to that statement based on how frequently each response is issued by the people the bot communicates with.
## Installation
This package can be installed from [PyPi](https://pypi.python.org/pypi/ChatterBot) by running:
```
pip install chatterbot
```
## Basic Usage
```
from chatterbot import ChatBot
from chatterbot.trainers import ChatterBotCorpusTrainer
chatbot = ChatBot('Ron Obvious')
# Create a new trainer for the chatbot
trainer = ChatterBotCorpusTrainer(chatbot)
# Train the chatbot based on the english corpus
trainer.train("chatterbot.corpus.english")
# Get a response to an input statement
chatbot.get_response("Hello, how are you today?")
```
# Training data
ChatterBot comes with a data utility module that can be used to train chat bots.
At the moment there is training data for over a dozen languages in this module.
Contributions of additional training data or training data
in other languages would be greatly appreciated. Take a look at the data files
in the [chatterbot-corpus](https://github.com/gunthercox/chatterbot-corpus)
package if you are interested in contributing.
```
from chatterbot.trainers import ChatterBotCorpusTrainer
# Create a new trainer for the chatbot
trainer = ChatterBotCorpusTrainer(chatbot)
# Train based on the english corpus
trainer.train("chatterbot.corpus.english")
# Train based on english greetings corpus
trainer.train("chatterbot.corpus.english.greetings")
# Train based on the english conversations corpus
trainer.train("chatterbot.corpus.english.conversations")
```
**Corpus contributions are welcome! Please make a pull request.**
# [Documentation](https://chatterbot.readthedocs.io/)
View the [documentation](https://chatterbot.readthedocs.io/)
for ChatterBot on Read the Docs.
To build the documentation yourself using [Sphinx](http://www.sphinx-doc.org/), run:
```
sphinx-build -b html docs/ build/
```
# Examples
For examples, see the [examples](https://github.com/gunthercox/ChatterBot/tree/master/examples)
directory in this project's git repository.
There is also an example [Django project using ChatterBot](https://github.com/gunthercox/ChatterBot/tree/master/examples), as well as an example [Flask project using ChatterBot](https://github.com/chamkank/flask-chatterbot).
# History
See release notes for changes https://github.com/gunthercox/ChatterBot/releases
# Development pattern for contributors
1. [Create a fork](https://help.github.com/articles/fork-a-repo/) of
the [main ChatterBot repository](https://github.com/gunthercox/ChatterBot) on GitHub.
2. Make your changes in a branch named something different from `master`, e.g. create
a new branch `my-pull-request`.
3. [Create a pull request](https://help.github.com/articles/creating-a-pull-request/).
4. Please follow the [Python style guide for PEP-8](https://www.python.org/dev/peps/pep-0008/).
5. Use the projects [built-in automated testing](https://chatterbot.readthedocs.io/en/latest/testing.html).
to help make sure that your contribution is free from errors.
# License
ChatterBot is licensed under the [BSD 3-clause license](https://opensource.org/licenses/BSD-3-Clause).
Raw data
{
"_id": null,
"home_page": "https://github.com/gunthercox/ChatterBotPy",
"name": "ChatterBotPy",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.4",
"maintainer_email": "",
"keywords": "ChatterBot,chatbot,chat,bot",
"author": "Gunther Cox",
"author_email": "gunthercx@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/90/96/b0c677c34f6f319353f4bb7b4ef0346df12a97caa739e85fd82d135b90ab/ChatterBotPy-1.1.3.tar.gz",
"platform": "any",
"description": "![ChatterBot: Machine learning in Python](https://i.imgur.com/b3SCmGT.png)\n\n# ChatterBot\n\nChatterBot is a machine-learning based conversational dialog engine build in\nPython which makes it possible to generate responses based on collections of\nknown conversations. The language independent design of ChatterBot allows it\nto be trained to speak any language.\n\n[![Package Version](https://img.shields.io/pypi/v/chatterbot.svg)](https://pypi.python.org/pypi/chatterbot/)\n[![Python 3.6](https://img.shields.io/badge/python-3.6-blue.svg)](https://www.python.org/downloads/release/python-360/)\n[![Django 2.0](https://img.shields.io/badge/Django-2.0-blue.svg)](https://docs.djangoproject.com/en/2.1/releases/2.0/)\n[![Requirements Status](https://requires.io/github/gunthercox/ChatterBot/requirements.svg?branch=master)](https://requires.io/github/gunthercox/ChatterBot/requirements/?branch=master)\n[![Build Status](https://travis-ci.org/gunthercox/ChatterBot.svg?branch=master)](https://travis-ci.org/gunthercox/ChatterBot)\n[![Documentation Status](https://readthedocs.org/projects/chatterbot/badge/?version=stable)](http://chatterbot.readthedocs.io/en/stable/?badge=stable)\n[![Coverage Status](https://img.shields.io/coveralls/gunthercox/ChatterBot.svg)](https://coveralls.io/r/gunthercox/ChatterBot)\n[![Code Climate](https://codeclimate.com/github/gunthercox/ChatterBot/badges/gpa.svg)](https://codeclimate.com/github/gunthercox/ChatterBot)\n[![Join the chat at https://gitter.im/chatterbot/Lobby](https://badges.gitter.im/chatterbot/Lobby.svg)](https://gitter.im/chatterbot/Lobby?utm_source=badge&utm_medium=badge&utm_content=badge)\n\nAn example of typical input would be something like this:\n\n> **user:** Good morning! How are you doing? \n> **bot:** I am doing very well, thank you for asking. \n> **user:** You're welcome. \n> **bot:** Do you like hats? \n\n## How it works\n\nAn untrained instance of ChatterBot starts off with no knowledge of how to communicate. Each time a user enters a statement, the library saves the text that they entered and the text that the statement was in response to. As ChatterBot receives more input the number of responses that it can reply and the accuracy of each response in relation to the input statement increase. The program selects the closest matching response by searching for the closest matching known statement that matches the input, it then returns the most likely response to that statement based on how frequently each response is issued by the people the bot communicates with.\n\n## Installation\n\nThis package can be installed from [PyPi](https://pypi.python.org/pypi/ChatterBot) by running:\n\n```\npip install chatterbot\n```\n\n## Basic Usage\n\n```\nfrom chatterbot import ChatBot\nfrom chatterbot.trainers import ChatterBotCorpusTrainer\n\nchatbot = ChatBot('Ron Obvious')\n\n# Create a new trainer for the chatbot\ntrainer = ChatterBotCorpusTrainer(chatbot)\n\n# Train the chatbot based on the english corpus\ntrainer.train(\"chatterbot.corpus.english\")\n\n# Get a response to an input statement\nchatbot.get_response(\"Hello, how are you today?\")\n```\n\n# Training data\n\nChatterBot comes with a data utility module that can be used to train chat bots.\nAt the moment there is training data for over a dozen languages in this module.\nContributions of additional training data or training data\nin other languages would be greatly appreciated. Take a look at the data files\nin the [chatterbot-corpus](https://github.com/gunthercox/chatterbot-corpus)\npackage if you are interested in contributing.\n\n```\nfrom chatterbot.trainers import ChatterBotCorpusTrainer\n\n# Create a new trainer for the chatbot\ntrainer = ChatterBotCorpusTrainer(chatbot)\n\n# Train based on the english corpus\ntrainer.train(\"chatterbot.corpus.english\")\n\n# Train based on english greetings corpus\ntrainer.train(\"chatterbot.corpus.english.greetings\")\n\n# Train based on the english conversations corpus\ntrainer.train(\"chatterbot.corpus.english.conversations\")\n```\n\n**Corpus contributions are welcome! Please make a pull request.**\n\n# [Documentation](https://chatterbot.readthedocs.io/)\n\nView the [documentation](https://chatterbot.readthedocs.io/)\nfor ChatterBot on Read the Docs.\n\nTo build the documentation yourself using [Sphinx](http://www.sphinx-doc.org/), run:\n\n```\nsphinx-build -b html docs/ build/\n```\n\n# Examples\n\nFor examples, see the [examples](https://github.com/gunthercox/ChatterBot/tree/master/examples)\ndirectory in this project's git repository.\n\nThere is also an example [Django project using ChatterBot](https://github.com/gunthercox/ChatterBot/tree/master/examples), as well as an example [Flask project using ChatterBot](https://github.com/chamkank/flask-chatterbot).\n\n# History\n\nSee release notes for changes https://github.com/gunthercox/ChatterBot/releases\n\n# Development pattern for contributors\n\n1. [Create a fork](https://help.github.com/articles/fork-a-repo/) of\n the [main ChatterBot repository](https://github.com/gunthercox/ChatterBot) on GitHub.\n2. Make your changes in a branch named something different from `master`, e.g. create\n a new branch `my-pull-request`.\n3. [Create a pull request](https://help.github.com/articles/creating-a-pull-request/).\n4. Please follow the [Python style guide for PEP-8](https://www.python.org/dev/peps/pep-0008/).\n5. Use the projects [built-in automated testing](https://chatterbot.readthedocs.io/en/latest/testing.html).\n to help make sure that your contribution is free from errors.\n\n# License\n\nChatterBot is licensed under the [BSD 3-clause license](https://opensource.org/licenses/BSD-3-Clause).\n",
"bugtrack_url": null,
"license": "BSD",
"summary": "ChatterBot is a machine learning, conversational dialog engine.",
"version": "1.1.3",
"project_urls": {
"Documentation": "https://chatterbot.readthedocs.io",
"Download": "https://github.com/gunthercox/ChatterBotPy/tarball/1.1.3",
"Homepage": "https://github.com/gunthercox/ChatterBotPy"
},
"split_keywords": [
"chatterbot",
"chatbot",
"chat",
"bot"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "6e0bec4de3d390b80d7d6ec6deab7f2b3a81578e3ea9b7ef8c1ac201914eddc3",
"md5": "6db4cbf3a5189f981c5224799692f3a7",
"sha256": "d7661bc0f832648f3fc7581c988d5a7ce6a32e11b8e990bb5e37bf4ce2b15407"
},
"downloads": -1,
"filename": "ChatterBotPy-1.1.3-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "6db4cbf3a5189f981c5224799692f3a7",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": ">=3.4",
"size": 64280,
"upload_time": "2023-11-24T10:06:27",
"upload_time_iso_8601": "2023-11-24T10:06:27.947212Z",
"url": "https://files.pythonhosted.org/packages/6e/0b/ec4de3d390b80d7d6ec6deab7f2b3a81578e3ea9b7ef8c1ac201914eddc3/ChatterBotPy-1.1.3-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "9096b0c677c34f6f319353f4bb7b4ef0346df12a97caa739e85fd82d135b90ab",
"md5": "90046804072c5fa58d01dfa7f1441029",
"sha256": "ab2c639be313644544f85c8e9c154d0e189fc8a7199e87128af08bad5b1331e4"
},
"downloads": -1,
"filename": "ChatterBotPy-1.1.3.tar.gz",
"has_sig": false,
"md5_digest": "90046804072c5fa58d01dfa7f1441029",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.4",
"size": 56973,
"upload_time": "2023-11-24T10:06:30",
"upload_time_iso_8601": "2023-11-24T10:06:30.296967Z",
"url": "https://files.pythonhosted.org/packages/90/96/b0c677c34f6f319353f4bb7b4ef0346df12a97caa739e85fd82d135b90ab/ChatterBotPy-1.1.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-11-24 10:06:30",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "gunthercox",
"github_project": "ChatterBotPy",
"github_not_found": true,
"lcname": "chatterbotpy"
}