This is a simple python chatbot which uses json file to store the data. It uses TF-IDF (Term Frequency-Inverse Document Frequency) vectorizer and a Multinomial Naive Bayes classifier to classify the user input and give the response.
This project is under development and soon will be supported to web with multi modal support.
demo.mp4
Use the package manager pip to install the required packages.
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
python train.py
python app.py
or
python3 -m venv venv
source venv/bin/activate
pip3 install -r requirements.txt
python3 train.py
python3 app.py
Arguments:
--port
or-p
: Change the port number (default: 5000)--server
or-s
: Change the server (default: Server is True, no UI)
python train.py
python app.py
or
python3 train.py
python3 app.py
python app.py --port 5001 --server 1 # Run the server on port 5001 and hide the UI
or
python app.py --port 5001 --server 0 # Run the server on port 5001 and show the UI
A very basic implementation of API using Python requests
library.
import requests
url = "http://127.0.0.1:5000/api/chat"
if __name__ == "__main__":
while True:
input_data = str(input("Enter your question: "))
data = {"question": input_data}
response = requests.post(url, json=data)
print("Bot:", response.json()["response"])
- Text support
- Custom response support
- YouTube Search support
- Google Search support
- Wikipedia Search support
- Google News support
- Google Maps support
- API support
- YouTube Video support
- Conversation continuance support
- Image search support
- Translation support
- Image support
- Audio support
- Video support
- Muliple language support
- Markdown support
- Speech to text support
- Text to speech support
- Customizable