This project is a simple philosophy chatbot that provides quotes based on different themes. The chatbot uses a machine learning model to classify user input into predefined categories and responds with relevant philosophical quotes.
The philosophy chatbot allows users to interact with it by asking for quotes on various philosophical themes. It uses a pre-trained model to classify user input and deliver quotes accordingly. You can also train the model with new intents using the provided script.
- Quote Generation: Provides quotes from various philosophical themes and authors.
- User Interaction: Simple command-line interface for interacting with the chatbot.
- Model Training: Train the chatbot on new intents using the
training.py
script.
To set up and use the chatbot, follow these steps:
-
Clone the Repository
git clone https://github.com/yourusername/philosophy-chatbot.git cd philosophy-chatbot
-
Install Dependencies
Install the required Python packages using
pip
. Ensure you have Python 3.6+.pip install -r requirements.txt
-
Prepare Data
Ensure you have the
intents.json
file with the correct format for intents and responses. -
Train the Model For a simple use, you don't need to train the model. Use the
training.py
script to train the model on the data provided inintents.json
. This script will generate the necessary model, tokenizer, and label encoder files.python training.py
-
Run the Chatbot
Once the model is trained, you can start the chatbot using:
python chatbot.py
To exit the chat, type
quit
.Start messaging with the bot (type 'quit' to stop)! User: Tell me a quote about love
-
chatbot.py
: Main script to run the chatbot. It loads the trained model and interacts with the user. -
training.py
: Script to train the model using the data fromintents.json
. It saves the model, tokenizer, and label encoder. -
intents.json
: File containing the philosophical themes and quotes. -
chatbot.keras
: Saved Keras model file (generated bytraining.py
). -
tokenizer.pickle
: Saved tokenizer object (generated bytraining.py
). -
label_encoder.pickle
: Saved label encoder object (generated bytraining.py
). -
requirements.txt
: List of Python dependencies needed for the project.ChatBot: "The only thing we have to fear is fear itself." - Franklin D. Roosevelt