W A lightweight chatbot built with FastAPI, Scikit-learn, and Jinja2 that uses TF-IDF and Logistic Regression for intent recognition. It features a REST API, auto model retraining when intents are updated, and a simple web-based UI for interactive conversations.
This is a simple chatbot built with FastAPI, Scikit-learn, and Jinja2, which uses machine learning to recognize user intent and respond accordingly.
intents.json
example:
{ "intents": [ { "tag": "greeting", "patterns": ["Hi", "Hello", "Hey"], "responses": ["Hello!", "Hi there!"] }, { "tag": "goodbye", "patterns": ["Bye", "Goodbye", "See you"], "responses": ["Goodbye!", "Take care!"] } ] }
Clone the project:
git clone https://github.com/sujit-codezen/chatbot_with_intent.git cd chatbot-intent python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate pip install -r requirements.txt
python model.py
uvicorn main:app --reload