A conversational AI chatbot that provides intelligent product recommendations based on market basket analysis using the Apriori algorithm. Built with Streamlit and powered by association rules mined from real-world transaction data.
- 💬 Conversational chatbot interface
- 🧠 NLP-based intent detection (e.g., "I need tea", "I want bread")
- 📈 Apriori-based market basket analysis for recommendations
- 🧺 Real transaction data support
- 🔁 Reset chat functionality
- 🧠 Similarity matching with fallback response
- ⚡ Built with Streamlit for quick deployment
git clone https://github.com/yourusername/market-basket-chatbot.git
cd market-basket-chatbot
pip install -r requirements.txt
streamlit run app.py
-
User Input — The chatbot interprets phrases like:
- "I need tea"
- "Do you have cookies?"
- "Give me bread"
-
NLP Matching — Uses string similarity to map input to known products.
-
Apriori Rules — Applies association rules to suggest items often bought together.
-
Bot Response — Returns top product recommendations in conversational style.
📁 market-basket-chatbot
├── app.py # Streamlit frontend
├── apriori.py # Apriori algorithm & rule generation
├── chatbot.py # NLP matching and suggestion logic
├── data/
│ └── transactions.csv # Input data (real-world transactions)
├── requirements.txt # Python dependencies
└── README.md # This file
🧑 You: I need tea
🤖 Bot: People who bought tea also often bought: sugar, cookies, bread.
🧑 You: i want soap
🤖 Bot: I didn’t quite get that. Try something likeI need milk
,I want bread
.
- Python 3.8+
- Streamlit
Install all dependencies via:
pip install -r requirements.txt