A simple Neural Network (NN)-based chatbot built in Python, trained using TensorFlow and deployed locally using Flask.
This chatbot responds to user messages based on trained conversational intents and can be easily run on your machine.
- 🗨️ Conversational chatbot powered by a neural network
- 📦 Trained using TensorFlow
- 🚀 Served locally via a Flask web app
- 🔌 Easy to extend with more intents
- 🛠 Uses NLP preprocessing and intent classification
Make sure you have the following installed:
- Python 3.8+
- pip (Python package installer)
Clone the repository:
git clone https://github.com/ShreedharG/Chatbot.git
cd ChatbotCreate and activate a virtual environment (recommended):
Linux / macOS
python -m venv venv
source venv/bin/activateWindows
python -m venv venv
venv\Scripts\activateInstall dependencies:
pip install -r requirements.txtStart the Flask application:
python app.pyThe chatbot will be available at localhost.
If you want to retrain the chatbot with updated intents:
Modify intents.json with new patterns and responses.
Run the training script:
python nlp_model.pyThis will generate updated model and tokenizer files.
- User input is tokenized and cleaned using NLP techniques
- Input is vectorized using a bag-of-words approach
- A neural network predicts the intent class
- A response is selected from the predicted intent
- Flask serves the chatbot through a web interface
- Learning NLP and neural networks
- Academic mini-project
- Base template for intent-based chatbots
- Backend chatbot logic for web applications
Contributions are welcome! Open a Pull Request
.
├── static/
├── templates/
├── app.py # Flask app
├── chatbot.py # Chatbot logic & response generation
├── chatbot_model.h5 # Trained neural network model
├── classes.pkl # Label encoder classes
├── db_helper.py # Database helper (if used)
├── function.py # Utility/helper functions
├── intents.json # Intent definitions (training data)
├── nlp_model.py # NLP preprocessing & model training
├── requirements.txt # Python dependencies
├── welcome_msg.txt # Startup / welcome message
├── words.pkl # Tokenized vocabulary
└── README.md