A newer version of the Gradio SDK is available: 6.15.1
metadata
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
- Speech recognition — OpenAI Whisper transcribes audio input
- NLP extraction — spaCy dependency parsing extracts ingredients, quantities, and cooking methods
- Nutrition mapping — USDA FoodData Central API maps each ingredient to its nutritional profile
- Health classification — RandomForest / XGBoost trained on nutritional features
- 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.
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