pennywa/Graph_Embeddings_Flavors
🧪 The Flavor Lab MVP: Flavor Pairing via Graph Embeddings
The Flavor Lab is a demonstration of a scientific, chemistry-backed recommendation system designed to generate surprising yet delicious flavor pairings.
Implements a Similarity Search Model based on the conceptual output of a Graph Embeddings Model
Link: https://huggingface.co/spaces/pennywa/GraphEmbeddingsFlavors
❗IMPORTANT: Current MVP Limitations (Mock Database Disclaimers)
This application is built as MVP using a simulated, extremely small dataset to demonstrate the principle of the Graph Embeddings model.
The following limitations are expected:
1) Small Ingredient Set: Only a few ingredients are "known" to the model. Entering an unknown ingredient will result in a "vector not found" error. Please enter Strawberry, Basil, or Chocolate for accuracy of results.
2) Inaccurate Profiles: The flavor vectors are mock data (not derived from the full FlavorGraph dataset). Therefore, some pairings and generated recipes may occasionally be nonsensical (high similarity score between two flavors that don't traditionally mix). For example, entering Vanilla would result in Garlic having the highest match. "Dish Concept: A unique Vanilla tart with a Garlic base and a Coconut dust." 🥴
This small database demonstrates the architecture and type of model intended for the final, larger project.
🧠 AI Model: Graph Embeddings Simulation
The core of this application simulates the prediction step of a Graph Embeddings Model:
- Model Training (Simulated): The application uses pre-defined vectors (
INGREDIENT_VECTORSinapp.py). In a full project, these vectors would be the low-dimensional mathematical representations of ingredients generated by training a Graph Embedding Model on the FlavorGraph database. - Prediction Logic: The
get_pairingsfunction calculates the Cosine Similarity between the input ingredient's vector and every other vector. - Output: Ranks the results by the resulting similarity score, providing scientifically backed pairings. Ingredients that are mathematically "closer" in the vector space share more aromatic compounds, leading to surprising and excellent pairings.
🛠️ Tech Stack & Deployment
- Model Type: Graph Embeddings / Similarity Search
- Web Framework: Gradio
- Core Libraries:
numpy,pandas - Deployment: Hugging Face Spaces (via Gradio SDK)
✨ MVP Features
- Input: User selects a base ingredient.
- Output: Generates the top 5 mathematically similar flavor pairings.
