A simple rule-based chatbot implemented in Python, designed to respond to specific inputs with predefined answers. This chatbot can be used in applications that require a basic automated response system without the need for machine learning or NLP.
- Customizable rules: Define custom rules and responses easily.
- Efficient handling: Responses are triggered by specific keywords or phrases.
- Easy to extend: Add more rules and responses as needed.
- Python-based: Lightweight and easily integrable into larger Python applications.
- Python 3.x
- Clone the repository:
git clone https://github.com/MJTech46/PY-rule-based-chatbot.git
- Navigate to the project directory:
cd PY-rule-based-chatbot
- Run the main Python script:
python main.py
- Enter input prompts to interact with the chatbot.
The knowledge base is stored in a JSON file named knowledge_base.json
, containing a list of questions and answers:
{
"questions": [
{
"question": "Hello",
"answer": "Hai, How is your day going?"
},
{
"question": "help",
"answer": "I am a simple chatbot. Ask me something related to my programmed responses."
},
{
"question": "bye",
"answer": "Goodbye! Have a nice day!"
}
]
}
Feel free to contribute by opening issues or submitting pull requests. Please ensure any code you submit is well-documented and tested.
This project is licensed under the MIT License.