An intelligent chatbot for food and nutrition analysis, powered by machine learning and natural language processing. It predicts meal types, analyzes nutrition, and provides food suggestions based on user queries.
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
Table of Contents
Smart Food Nutrition Chatbot is a machine learning-based conversational assistant that helps users analyze food nutrition, predict meal types, and get healthy food suggestions. It leverages deep learning (TensorFlow/Keras), NLP, and a curated food dataset to provide accurate and interactive responses.
Key features:
- Predicts meal type (Low/Medium/High nutrition density) from food queries
- Analyzes nutrition facts and provides per-serving breakdowns
- Suggests similar foods and handles fuzzy/semantic queries
- Supports autocorrection, synonym matching, and user-friendly CLI
To get a local copy up and running, follow these steps.
- Python 3.9+
- pip
- (Optional) conda for environment management
- Clone the repository:
git clone https://github.com/LoveDoLove-School-Projects/FoodNutritionChatbot.git cd FoodNutritionChatbot - (Recommended) Create and activate a virtual environment:
conda create --name foodnutri python=3.9 conda activate foodnutri # or python -m venv venv venv\Scripts\activate # Windows source venv/bin/activate # Linux/Mac
- Install dependencies:
pip install tensorflow-cpu==2.10 tensorflow-directml-plugin numpy<2.0 pandas joblib scikit-learn fuzzywuzzy nltk matplotlib seaborn tabulate rouge_score pyyaml pulp ipywidgets python-Levenshtein autocorrect rich - Download NLTK data:
import nltk nltk.download('wordnet') nltk.download('omw-1.4')
- (Optional) For GPU support, ensure compatible hardware and drivers.
Run the chatbot CLI:
python Sources/ML-Based-ChatBot.ipynb
# or convert to .py and run:
# jupyter nbconvert --to script Sources/ML-Based-ChatBot.ipynb
# python Sources/ML-Based-ChatBot.pyInteract with the chatbot in your terminal. Example queries:
- "How many calories in 100g chicken breast?"
- "Suggest foods similar to broccoli."
- "Is oatmeal a high nutrition meal?"
The chatbot will analyze, predict, and respond with nutrition facts, meal type, and suggestions.
Contributions are welcome! Please fork the repo and submit a pull request, or open an issue for suggestions and bug reports.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.
LoveDoLove - @LoveDoLove
Project Link: https://github.com/LoveDoLove-School-Projects/FoodNutritionChatbot