A beginner-friendly chatbot built using Python and NLTK (Natural Language Toolkit). This chatbot can recognize a few basic greetings and questions, then respond accordingly.
π Features
Uses NLTK for tokenization.
Recognizes simple inputs like greetings and questions.
Runs in the terminal with an interactive chat loop.
Easy to extend with new responses.
π Project Structure chatbot.py # Main chatbot script
π§ Installation
Clone this repository:
git clone https://github.com/your-username/simple-python-chatbot.git cd simple-python-chatbot
Install dependencies:
pip install nltk
Run the script:
python chatbot.py
π» Usage
After running the script, type messages to interact with the chatbot:
π€ Chatbot: Hello! Type something (or type 'exit' to quit): You: hello π€ Chatbot: Hi there! How can I help you?
You: what is your name π€ Chatbot: I'm your Python-powered chatbot.
You: bye π€ Chatbot: Goodbye! Have a great day!
Type exit anytime to quit the chatbot.
π οΈ Extend the Chatbot
To add new responses, simply edit the pairs dictionary in chatbot.py:
pairs = { "hello": "Hi there! How can I help you?", "thanks": "You're welcome!", "who created you": "I was built with Python and NLTK!" }
π Requirements
Python 3.x
NLTK
π Learning Goals
This project is perfect for beginners who want to:
Learn about basic NLP with Python.
Understand tokenization using NLTK.
Build and customize a rule-based chatbot.
π€ Contributing
Pull requests are welcome! Feel free to improve the chatbot by adding new features like:
More advanced NLP techniques.
A GUI using Tkinter or PyQt.
Integration with machine learning models.
π License
This project is licensed under the MIT License.