Chatterbox is a lightweight, rule-based conversational agent built entirely in Python. Designed as a foundational project to explore Natural Language Processing (NLP) concepts and interactive command-line applications, Chatterbox demonstrates how continuous loops and conditional logic can simulate human-like conversations.
This project showcases fundamental programming paradigms, including continuous while loops for session management and if-elif-else control flow for pattern matching and response generation. It serves as an excellent starting point for understanding how chatbots parse user inputs and trigger appropriate responses based on specific keywords.
- 🗣️ Greetings & Salutations: Understands basic greetings like "hello", "hi", and "hey".
- 👤 Identity Awareness: Can answer questions about its own identity (e.g., "who are you?", "your name").
- ☕ Small Talk: Engages in simple conversational topics such as inquiring about well-being or the weather.
- 😄 Humor: Equipped with a programming joke to lighten the mood.
- 🚪 Graceful Exit: Detects exit commands ("bye", "quit", "exit") and politely terminates the session.
- 🔠 Case-Insensitive Parsing: Input parsing is normalized to seamlessly handle different capitalizations (e.g., "HELLO" vs "hello").
- Python 3.6 or higher is required.
- Clone the repository:
git clone https://github.com/abhranilsingharoy-cloud/Chatterbox.git
- Navigate to the project directory:
cd Chatterbox
You can start the chatbot directly via Python, or use one of the provided run scripts based on your operating system.
Using Python directly:
python chatbot.pyUsing the Shell Script (Linux/macOS):
./run_chatbot.shUsing the Batch File (Windows):
run_chatbot.batThe repository includes a suite of test cases to verify the chatbot's conversational capabilities. We use the standard unittest framework.
To run the tests, execute the following command in the project directory:
python -m unittest test_chatbot.pyYou can also view the manual test inputs and expected outputs in test_cases.txt.
Abhranil Singha Roy
- GitHub: @abhranilsingharoy-cloud
This project was built during the early stages of my software engineering career to explore Python and logic-based systems.