This is a chatbot web application built using Flask, PyTorch, and NLTK. It provides a chat interface where users can interact with the chatbot to get responses based on the provided patterns and intents.
- Allows users to have a conversation with the chatbot.
- Provides responses based on the trained model and predefined intents.
- Handles user input and displays chat messages in real-time.
- Python 3.6 or higher
- Flask
- PyTorch
- NLTK
- TorchVision
- Clone the repository:
git clone https://github.com/sasankaweera123/website_chatbot.git
- Install the required dependencies:
pip install -r requirements.txt
-
Train the chatbot model:
-
Update the
intents.json
file with your own intents, patterns, and responses. -
Run the
train_chatbot.py
script to train the model:python train_chatbot.py
-
-
Run the web application:
python app.py
- Open your browser and navigate to
http://localhost:5000
to access the chatbot interface.
- Type your message in the input field and press Enter or click the Send button to send your message to the chatbot.
- The chat messages will be displayed in the chatbox.
- The chatbot will respond with an appropriate message based on the provided patterns and intents.
- To customize the chatbot behavior, update the
intents.json
file with your own intents, patterns, and responses. - You can modify the HTML template (
base.html
) and CSS styles (style.css
) to change the appearance of the chatbox interface.
- This project is based on the tutorial by patrickloeber on building a chatbot with PyTorch and Flask. Thank you for the helpful tutorial and code examples!