he99codes's picture
Clean deployment with LFS setup correctly
f75c5b2
---
title: Recipe Health Analyzer
emoji: πŸ₯—
colorFrom: green
colorTo: green
sdk: gradio
sdk_version: "6.9.0"
app_file: app.py
pinned: false
license: mit
short_description: AI pipeline that classifies recipe health from text or audio
---
# πŸ₯— Recipe Health Analyzer
An end-to-end AI pipeline that analyzes spoken or written food recipes and classifies them as **Healthy**, **Moderately Healthy**, or **Unhealthy** β€” with full SHAP-based explainability.
## Pipeline stages
1. **Speech recognition** β€” OpenAI Whisper transcribes audio input
2. **NLP extraction** β€” spaCy dependency parsing extracts ingredients, quantities, and cooking methods
3. **Nutrition mapping** β€” USDA FoodData Central API maps each ingredient to its nutritional profile
4. **Health classification** β€” RandomForest / XGBoost trained on nutritional features
5. **Explainability** β€” SHAP values + natural language reasons + actionable suggestions
## Setup
Set your `USDA_API_KEY` in Space Secrets (Settings β†’ Variables and secrets).
Get a free key at [fdc.nal.usda.gov/api-key-signup.html](https://fdc.nal.usda.gov/api-key-signup.html).
Without a key the app uses `DEMO_KEY` which is rate-limited to ~30 req/hour.
## Tech stack
`spaCy` Β· `openai-whisper` Β· `scikit-learn` Β· `xgboost` Β· `shap` Β· `gradio`