Sign inSign up

sajithjeewantha/chat-bot

By sajithjeewantha

•Updated 8 months ago

Lightweight TF-IDF retrieval-based chatbot

Image
Machine learning & AI
0

130

sajithjeewantha/chat-bot repository overview

⁠sajithjeewantha/chat-bot

Lightweight TF-IDF retrieval chatbot container.

A lightweight, retrieval-based chatbot powered by TF‑IDF similarity and the UltraChat dataset. The bot responds to your messages by finding the most similar user input in its precomputed index and returning the corresponding assistant reply.

⁠📦 What is this image?

This image runs a Flask web service (port 5000) that exposes a single endpoint /chat. When you send a JSON payload with a "message" field, the bot vectorises the text, compares it against 2 million user‑assistant pairs from the openbmb/UltraChat dataset, and returns the most relevant answer – or a polite fallback if the confidence is too low.

⁠🚀 Quick Start

⁠Pull the image
docker pull sajithjeewantha/chat-bot:v1.0
⁠Run a container
docker run --name chat-bot-live -p 5001:5000 sajithjeewantha/chat-bot:v1.0

You can also open http://localhost:5001⁠ in a browser for a simple chat interface (if one is included).

  • -p 5001:5000 – maps host port 5001 to container port 5000.
  • The container starts a web server; use -d to run in the background.
PortPurpose
5000App
5001Host

⁠⚙️ Environment variables

VariableDefaultDescription
THRESHOLD0.25Minimum cosine similarity required to return an answer.
DATA_PATH/app/pairs.jsonlPath to the JSONL file containing the input–output pairs.
MAX_FEATURES200000Vocabulary size for the TF‑IDF vectorizer.

⁠🔍 Under the hood

  • TF‑IDF vectorisation (200k features, English stop words removed)
  • Cosine similarity for fast nearest‑neighbour search
  • 2M (user → assistant) pairs extracted from UltraChat
  • Flask server with a single POST endpoint
  • Memory‑efficient – the index and vectors are loaded at startup

Tag summary

Content type

Image

Digest

sha256:00227e013…

Size

687.4 MB

Last updated

8 months ago

docker pull sajithjeewantha/chat-bot:v1.0