Skip to main content

A Python chatbot that learns as you speak to it.

Project description

Thomas

Thomas the Chatbot

Demo

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

Black, isort and Prettier are used for 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)

Uploaded Source

Built Distribution

thomasthechatbot-1.0.5-py3-none-any.whl (10.6 kB view hashes)

Uploaded Python 3

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