CodeAlpha AI Internship | Task 2
An NLP-powered FAQ chatbot focused on fitness and nutrition. Uses TF-IDF vectorization and cosine similarity to match user questions with the most relevant FAQ answer.
- 🤖 NLP-powered matching — TF-IDF + cosine similarity via scikit-learn
- 🧹 Text preprocessing — tokenization, stopword removal via NLTK
- 💬 Chat UI — Streamlit chat interface with message history
- ⚡ Quick suggestions — one-click example questions
- 🏋️ 30+ FAQs — covering protein, workouts, supplements, fat loss, muscle building
| Tool | Purpose |
|---|---|
Streamlit |
Chat UI |
NLTK |
Tokenization & stopword removal |
scikit-learn |
TF-IDF vectorization & cosine similarity |
Python 3.8+ |
Core language |
git clone https://github.com/YOUR_USERNAME/CodeAlpha_FAQChatbot.git
cd CodeAlpha_FAQChatbotpip install -r requirements.txtstreamlit run app.pyCodeAlpha_FAQChatbot/
├── app.py # Main Streamlit app + NLP logic
├── faqs.py # FAQ dataset (70+ Q&A pairs)
├── requirements.txt # Dependencies
└── README.md # This file
- User types a question
- Question is preprocessed (lowercased, punctuation removed, stopwords filtered)
- TF-IDF vectorizer converts all FAQ questions + user question into vectors
- Cosine similarity finds the closest matching FAQ
- If similarity > threshold (0.15), the matched answer is returned
- Otherwise, a fallback message is shown
Built as part of the CodeAlpha AI Internship program.