A Python chatbot that learns as you speak to it.
Project description
Thomas the Chatbot
Installation
Python 3.9+ is required
This package can be installed from PyPi with:
pip install thomasthechatbot
CLI
Type ttc
to begin talking to Thomas.
How does Thomas work?
I wrote a medium article to explain how Thomas works.
Usage
Basic Usage
from ttc import Chatbot, Context, download_nltk_data
# Only needs to be run once (can be removed after first run)
download_nltk_data()
# Creating the context
ctx = Context()
# Initializing the chatbot
chatbot = Chatbot()
talk = True
while talk:
msg = input("You: ")
if msg == "s":
talk = False
else:
# Getting the response
resp = chatbot.respond(ctx, msg)
# Saving the response to the context
ctx.save_resp(resp)
print(f"Thomas: {resp}")
# Saving the chatbot data
chatbot.save_data()
Configurations
chatbot = Chatbot(
path="brain",
learn=False,
min_score=0.5,
score_threshold=0.5,
mesh_association=0.5,
)
Contributing
Open to contributions, please create an issue if you want to do so.
Formatting
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
thomasthechatbot-1.0.5.tar.gz
(8.3 kB
view hashes)
Built Distribution
Close
Hashes for thomasthechatbot-1.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54cf7e1cf242240735f46f9b9ef73ae08c0ba5ec8f66d7a7229ff1716c89495f |
|
MD5 | ba2b196baa646d6b2966fd70538ec902 |
|
BLAKE2b-256 | b8c65e11252ffd141eadae3e4da92f3e0682be546a2bbeb0e83b6fa98009f91a |