Student: bharat singh chouhan
Student ID: CA/DE1/1099
Domain: Python Programming
This project is a simple pattern-matching chatbot built using Python.
Instead of basic if-else replies, the chatbot uses Regular Expressions (Regex) to understand user messages.
It detects greetings, identity questions, exit messages, and general queries using pattern matching and responds accordingly.
This is a part of the CodeAlpha Python Programming Internship.
- Regex-based pattern recognition
- Handles greetings, questions, thanks, and exit commands
- Clean knowledge base for easy expansion
- Converts input to lowercase for reliable matching
- Continues conversation until the user exits
- Includes a fallback response for unknown messages
- User input is converted to lowercase
- Each regex pattern in the KNOWLEDGE_BASE is checked
- The first matching pattern returns the response
- If nothing matches, a default fallback reply is sent
Open terminal inside the project folder and run:
You: hello Bot: Hello there! How may I assist you today?
You: how are you Bot: I am an AI, so I don't have feelings, but I'm functioning perfectly! Thanks for asking!
You: your name Bot: I am a simple Pattern-Matching Chatbot, created using Python for the CodeAlpha task.
You: bye Bot: Goodbye! It was great chatting with you. Come back soon!
- This is a rule-based chatbot, not an AI model
- All patterns can be extended by adding new regex keys
- No external libraries required (uses only Python’s built-in re module)