Spaces:
Running
Running
Add UMAP visualisation, fridge parser, basket cosine heatmap (8 tabs total)
Browse files- __pycache__/app.cpython-310.pyc +0 -0
- app.py +360 -112
- ingredient_labels.json +1 -0
- requirements.txt +2 -0
- umap_2d.npz +3 -0
__pycache__/app.cpython-310.pyc
CHANGED
|
Binary files a/__pycache__/app.cpython-310.pyc and b/__pycache__/app.cpython-310.pyc differ
|
|
|
app.py
CHANGED
|
@@ -1,23 +1,27 @@
|
|
| 1 |
"""Epicure Explorer: chef-facing operators over the three sibling embeddings.
|
| 2 |
|
| 3 |
-
|
| 4 |
-
- Basket pairings
|
| 5 |
-
- Supervised SLERP
|
| 6 |
-
- Emergent SLERP
|
| 7 |
-
- Arithmetic
|
| 8 |
-
- Mode atlas
|
| 9 |
-
- Compare siblings
|
| 10 |
-
|
| 11 |
-
|
|
|
|
| 12 |
Paper: https://arxiv.org/abs/2605.22391
|
| 13 |
"""
|
| 14 |
|
| 15 |
from __future__ import annotations
|
| 16 |
|
| 17 |
import os
|
|
|
|
| 18 |
import sys
|
|
|
|
| 19 |
import numpy as np
|
| 20 |
import gradio as gr
|
|
|
|
| 21 |
|
| 22 |
try:
|
| 23 |
from epicure import Epicure
|
|
@@ -27,6 +31,8 @@ except ImportError:
|
|
| 27 |
sys.path.insert(0, os.path.dirname(epicure_py))
|
| 28 |
from epicure import Epicure
|
| 29 |
|
|
|
|
|
|
|
| 30 |
MODELS = {
|
| 31 |
"cooc": Epicure.from_pretrained("Kaikaku/epicure-cooc"),
|
| 32 |
"core": Epicure.from_pretrained("Kaikaku/epicure-core"),
|
|
@@ -34,19 +40,35 @@ MODELS = {
|
|
| 34 |
}
|
| 35 |
ALL_INGREDIENTS = sorted(MODELS["cooc"].vocab.keys())
|
| 36 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
# ===== math helpers =====
|
| 38 |
|
| 39 |
def _unit(v: np.ndarray, eps: float = 1e-9) -> np.ndarray:
|
| 40 |
n = np.linalg.norm(v); return v / max(n, eps)
|
| 41 |
|
| 42 |
-
def _basket_centroid(m
|
| 43 |
valid = [n for n in (names or []) if n in m.vocab]
|
| 44 |
-
if not valid:
|
| 45 |
-
|
| 46 |
-
idxs = [m.vocab[n] for n in valid]
|
| 47 |
-
return _unit(m.E[idxs].mean(axis=0))
|
| 48 |
|
| 49 |
-
def _stack_directions(m
|
| 50 |
poles = []
|
| 51 |
for k in keys or []:
|
| 52 |
if use_factor_pole:
|
|
@@ -56,110 +78,116 @@ def _stack_directions(m: Epicure, keys: list[str], use_factor_pole: bool = False
|
|
| 56 |
else:
|
| 57 |
if k in m.supervised_poles:
|
| 58 |
poles.append(_unit(m.supervised_poles[k]))
|
| 59 |
-
if not poles:
|
| 60 |
-
return None
|
| 61 |
return _unit(np.stack(poles, axis=0).sum(axis=0))
|
| 62 |
|
| 63 |
-
def _topk(m
|
| 64 |
sims = m.E @ q
|
| 65 |
-
for
|
| 66 |
-
if
|
| 67 |
-
sims[m.vocab[name]] = -np.inf
|
| 68 |
order = np.argsort(-sims)
|
| 69 |
return [(m.itos[int(i)], float(sims[i])) for i in order[:k]]
|
| 70 |
|
| 71 |
-
def _supervised_choices(sibling
|
| 72 |
return sorted(MODELS[sibling].supervised_poles.keys())
|
| 73 |
|
| 74 |
-
def _factor_mode_choices(sibling
|
| 75 |
return [(f"{m.label} ({m.mode_id})", m.mode_id) for m in MODELS[sibling].modes if m.kind == "factor"]
|
| 76 |
|
| 77 |
-
def _slerp(m
|
| 78 |
d_perp = d - (d @ v) * v
|
| 79 |
-
|
| 80 |
-
if
|
| 81 |
-
|
| 82 |
-
d_perp = d_perp / n_perp
|
| 83 |
th = np.deg2rad(float(theta_deg))
|
| 84 |
-
return _unit(np.cos(th)
|
| 85 |
-
|
| 86 |
|
| 87 |
# ===== tab handlers =====
|
| 88 |
|
| 89 |
-
def basket_pairings(sibling
|
| 90 |
m = MODELS[sibling]
|
| 91 |
centroid = _basket_centroid(m, basket)
|
| 92 |
if centroid is None:
|
| 93 |
-
return [], []
|
| 94 |
-
nb = _topk(m, centroid, k
|
| 95 |
scored = [(mode.mode_id, mode.label, mode.kind, float(_unit(mode.pole) @ centroid)) for mode in m.modes]
|
| 96 |
scored.sort(key=lambda x: -x[3])
|
|
|
|
| 97 |
return (
|
| 98 |
[[name, f"{sim:.4f}"] for name, sim in nb],
|
| 99 |
[[mid, label, kind, f"{sim:.4f}"] for mid, label, kind, sim in scored[:k]],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 100 |
)
|
|
|
|
| 101 |
|
| 102 |
-
def supervised_slerp_multi(sibling
|
| 103 |
m = MODELS[sibling]
|
| 104 |
v = _basket_centroid(m, basket)
|
|
|
|
| 105 |
d = _stack_directions(m, directions, use_factor_pole=False)
|
| 106 |
-
if v is None:
|
| 107 |
-
return []
|
| 108 |
if d is None:
|
| 109 |
return [[n, f"{s:.4f}"] for n, s in _topk(m, v, k, basket)]
|
| 110 |
q = _slerp(m, v, d, theta)
|
| 111 |
-
return [[
|
| 112 |
|
| 113 |
-
def emergent_slerp_multi(sibling
|
| 114 |
m = MODELS[sibling]
|
| 115 |
label_to_id = {f"{mode.label} ({mode.mode_id})": mode.mode_id for mode in m.modes if mode.kind == "factor"}
|
| 116 |
mode_ids = [label_to_id[lab] for lab in (mode_labels or []) if lab in label_to_id]
|
| 117 |
v = _basket_centroid(m, basket)
|
|
|
|
| 118 |
d = _stack_directions(m, mode_ids, use_factor_pole=True)
|
| 119 |
-
if v is None:
|
| 120 |
-
return []
|
| 121 |
if d is None:
|
| 122 |
return [[n, f"{s:.4f}"] for n, s in _topk(m, v, k, basket)]
|
| 123 |
q = _slerp(m, v, d, theta)
|
| 124 |
-
return [[
|
| 125 |
|
| 126 |
-
def arithmetic(sibling
|
| 127 |
m = MODELS[sibling]
|
| 128 |
pos = _basket_centroid(m, positives)
|
| 129 |
-
if pos is None:
|
| 130 |
-
return []
|
| 131 |
neg = _basket_centroid(m, negatives) if negatives else None
|
| 132 |
q = _unit(pos - neg) if neg is not None else pos
|
| 133 |
-
return [[
|
| 134 |
|
| 135 |
-
def browse_modes(sibling
|
| 136 |
m = MODELS[sibling]
|
| 137 |
-
rows = []
|
| 138 |
-
q = (query or "").strip().lower()
|
| 139 |
for mode in m.modes:
|
| 140 |
if kind_filter != "all" and mode.kind != kind_filter:
|
| 141 |
continue
|
| 142 |
if q and q not in mode.label.lower() and q not in mode.property.lower():
|
| 143 |
continue
|
| 144 |
-
rows.append([
|
| 145 |
-
mode.mode_id,
|
| 146 |
-
mode.kind,
|
| 147 |
-
mode.property,
|
| 148 |
-
mode.label,
|
| 149 |
-
mode.n_members,
|
| 150 |
-
", ".join(mode.members[:12]),
|
| 151 |
-
])
|
| 152 |
rows.sort(key=lambda r: (r[1], -r[4]))
|
| 153 |
return rows
|
| 154 |
|
| 155 |
-
def compare_siblings(basket
|
| 156 |
out = []
|
| 157 |
-
for sib in ["cooc",
|
| 158 |
m = MODELS[sib]
|
| 159 |
v = _basket_centroid(m, basket)
|
| 160 |
if v is None:
|
| 161 |
out.append([]); continue
|
| 162 |
-
# Direction set can use any pole key; we intersect with this sibling's supervised_poles
|
| 163 |
valid_dirs = [d for d in (directions or []) if d in m.supervised_poles]
|
| 164 |
if valid_dirs:
|
| 165 |
d_vec = _stack_directions(m, valid_dirs)
|
|
@@ -167,9 +195,197 @@ def compare_siblings(basket: list[str], directions: list[str], theta: float, k:
|
|
| 167 |
else:
|
| 168 |
q = v
|
| 169 |
hits = _topk(m, q, k=k, exclude=basket)
|
| 170 |
-
out.append([[
|
| 171 |
return out[0], out[1], out[2]
|
| 172 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 173 |
|
| 174 |
# ===== UI =====
|
| 175 |
|
|
@@ -184,17 +400,19 @@ from [arXiv:2605.22391](https://arxiv.org/abs/2605.22391).
|
|
| 184 |
- **Core** blends typed FlavorDB compound walks with injected I-I walks. Concentrated geometry, tightest modes.
|
| 185 |
- **Chem** walks typed FlavorDB compound metapaths only. Strongest supervised-direction recovery; neighbours are flavour-profile peers.
|
| 186 |
|
| 187 |
-
Pick a sibling, then explore. Each tab has
|
| 188 |
"""
|
| 189 |
)
|
| 190 |
|
| 191 |
-
sibling = gr.Radio(choices=["cooc",
|
| 192 |
|
| 193 |
-
# ---------- Tab 1: Basket pairings ----------
|
| 194 |
with gr.Tab("Basket pairings"):
|
| 195 |
gr.Markdown(
|
| 196 |
-
"Pick one or more ingredients.
|
| 197 |
-
"
|
|
|
|
|
|
|
| 198 |
)
|
| 199 |
basket = gr.Dropdown(
|
| 200 |
choices=ALL_INGREDIENTS, value=["chicken","lemon","garlic"],
|
|
@@ -205,7 +423,12 @@ Pick a sibling, then explore. Each tab has a few worked examples just below the
|
|
| 205 |
with gr.Row():
|
| 206 |
nb_table = gr.Dataframe(headers=["Neighbour","Cosine"], label="Top-K nearest neighbours", interactive=False)
|
| 207 |
mode_table = gr.Dataframe(headers=["Mode id","Label","Kind","Cosine"], label="Closest modes", interactive=False)
|
| 208 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 209 |
gr.Examples(
|
| 210 |
examples=[
|
| 211 |
["chem", ["chicken","lemon","garlic"], 8],
|
|
@@ -224,9 +447,8 @@ Pick a sibling, then explore. Each tab has a few worked examples just below the
|
|
| 224 |
# ---------- Tab 2: Supervised SLERP ----------
|
| 225 |
with gr.Tab("Supervised SLERP"):
|
| 226 |
gr.Markdown(
|
| 227 |
-
"Rotate the
|
| 228 |
-
"
|
| 229 |
-
"multi-constraint queries (e.g. 'chicken + processed + Western_Atlantic')."
|
| 230 |
)
|
| 231 |
sup_basket = gr.Dropdown(
|
| 232 |
choices=ALL_INGREDIENTS, value=["rice"],
|
|
@@ -242,10 +464,7 @@ Pick a sibling, then explore. Each tab has a few worked examples just below the
|
|
| 242 |
sup_btn = gr.Button("Rotate", variant="primary")
|
| 243 |
sup_table = gr.Dataframe(headers=["Ingredient","Cosine"], label="Top-K rotated-query neighbours")
|
| 244 |
sup_btn.click(supervised_slerp_multi, inputs=[sibling, sup_basket, sup_dirs, sup_theta, sup_k], outputs=sup_table)
|
| 245 |
-
sibling.change(
|
| 246 |
-
lambda s: gr.Dropdown(choices=_supervised_choices(s), value=[]),
|
| 247 |
-
inputs=sibling, outputs=sup_dirs,
|
| 248 |
-
)
|
| 249 |
gr.Examples(
|
| 250 |
examples=[
|
| 251 |
["chem", ["rice"], ["cuisine:South_Asian"], 30, 8],
|
|
@@ -281,26 +500,17 @@ Pick a sibling, then explore. Each tab has a few worked examples just below the
|
|
| 281 |
em_btn = gr.Button("Rotate", variant="primary")
|
| 282 |
em_table = gr.Dataframe(headers=["Ingredient","Cosine"], label="Top-K rotated-query neighbours")
|
| 283 |
em_btn.click(emergent_slerp_multi, inputs=[sibling, em_basket, em_modes, em_theta, em_k], outputs=em_table)
|
| 284 |
-
sibling.change(
|
| 285 |
-
lambda s: gr.Dropdown(choices=[label for label, _ in _factor_mode_choices(s)], value=[]),
|
| 286 |
-
inputs=sibling, outputs=em_modes,
|
| 287 |
-
)
|
| 288 |
|
| 289 |
# ---------- Tab 4: Arithmetic ----------
|
| 290 |
with gr.Tab("Arithmetic"):
|
| 291 |
gr.Markdown(
|
| 292 |
"Classic Mikolov-style vector arithmetic: `centroid(positives) - centroid(negatives)`, "
|
| 293 |
-
"then top-K nearest neighbours. The killer demo is `miso - salt` on Core
|
| 294 |
-
"Japanese fermented-umami pantry minus the salty component
|
| 295 |
-
)
|
| 296 |
-
pos_box = gr.Dropdown(
|
| 297 |
-
choices=ALL_INGREDIENTS, value=["miso"],
|
| 298 |
-
label="Positives (added)", multiselect=True, max_choices=10,
|
| 299 |
-
)
|
| 300 |
-
neg_box = gr.Dropdown(
|
| 301 |
-
choices=ALL_INGREDIENTS, value=["salt"],
|
| 302 |
-
label="Negatives (subtracted)", multiselect=True, max_choices=10,
|
| 303 |
)
|
|
|
|
|
|
|
| 304 |
ar_k = gr.Slider(1, 15, value=8, step=1, label="K")
|
| 305 |
ar_btn = gr.Button("Compute", variant="primary")
|
| 306 |
ar_table = gr.Dataframe(headers=["Ingredient","Cosine"], label="Top-K nearest to result vector")
|
|
@@ -320,21 +530,15 @@ Pick a sibling, then explore. Each tab has a few worked examples just below the
|
|
| 320 |
label="Try one of these arithmetic queries",
|
| 321 |
)
|
| 322 |
|
| 323 |
-
# ---------- Tab 5: Mode atlas
|
| 324 |
with gr.Tab("Mode atlas"):
|
| 325 |
gr.Markdown(
|
| 326 |
-
"Browse the GMM mode atlas of the selected sibling
|
| 327 |
-
"
|
| 328 |
-
"`
|
| 329 |
-
"`binary` modes are food-group buckets. Search by label or property substring."
|
| 330 |
-
)
|
| 331 |
-
atlas_kind = gr.Radio(
|
| 332 |
-
choices=["all","factor","continuous","binary"], value="all", label="Mode kind"
|
| 333 |
-
)
|
| 334 |
-
atlas_search = gr.Textbox(
|
| 335 |
-
label="Search labels / properties", placeholder="e.g. South Asian, baking, fiber",
|
| 336 |
-
value="",
|
| 337 |
)
|
|
|
|
|
|
|
| 338 |
atlas_btn = gr.Button("Browse modes", variant="primary")
|
| 339 |
atlas_table = gr.Dataframe(
|
| 340 |
headers=["mode_id","kind","property","label","n_members","top members"],
|
|
@@ -346,17 +550,12 @@ Pick a sibling, then explore. Each tab has a few worked examples just below the
|
|
| 346 |
# ---------- Tab 6: Compare siblings ----------
|
| 347 |
with gr.Tab("Compare siblings"):
|
| 348 |
gr.Markdown(
|
| 349 |
-
"
|
| 350 |
-
"view the paper is built around: Cooc shows recipe companions, Chem shows chemistry peers, "
|
| 351 |
-
"Core sits in between. Leave the direction empty for pure basket pairings."
|
| 352 |
-
)
|
| 353 |
-
cmp_basket = gr.Dropdown(
|
| 354 |
-
choices=ALL_INGREDIENTS, value=["chicken"],
|
| 355 |
-
label="Seed basket (pick 1+)", multiselect=True, max_choices=10,
|
| 356 |
)
|
|
|
|
| 357 |
cmp_dirs = gr.Dropdown(
|
| 358 |
choices=_supervised_choices("chem"), value=[],
|
| 359 |
-
label="Optional
|
| 360 |
multiselect=True, max_choices=5,
|
| 361 |
)
|
| 362 |
cmp_theta = gr.Slider(0, 90, value=30, step=5, label="Rotation angle (deg; ignored if no directions)")
|
|
@@ -366,11 +565,7 @@ Pick a sibling, then explore. Each tab has a few worked examples just below the
|
|
| 366 |
cmp_cooc = gr.Dataframe(headers=["Cooc neighbour","Cosine"], label="Cooc (recipe-context)")
|
| 367 |
cmp_core = gr.Dataframe(headers=["Core neighbour","Cosine"], label="Core (blended)")
|
| 368 |
cmp_chem = gr.Dataframe(headers=["Chem neighbour","Cosine"], label="Chem (chemistry)")
|
| 369 |
-
cmp_btn.click(
|
| 370 |
-
compare_siblings,
|
| 371 |
-
inputs=[cmp_basket, cmp_dirs, cmp_theta, cmp_k],
|
| 372 |
-
outputs=[cmp_cooc, cmp_core, cmp_chem],
|
| 373 |
-
)
|
| 374 |
gr.Examples(
|
| 375 |
examples=[
|
| 376 |
[["chicken"], [], 0, 8],
|
|
@@ -384,6 +579,59 @@ Pick a sibling, then explore. Each tab has a few worked examples just below the
|
|
| 384 |
label="Try one of these side-by-side comparisons",
|
| 385 |
)
|
| 386 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 387 |
gr.Markdown(
|
| 388 |
"""---
|
| 389 |
**Cite:** Radzikowski and Chen, 2026, *Epicure: Navigating the Emergent Geometry of Food Ingredient Embeddings*, [arXiv:2605.22391](https://arxiv.org/abs/2605.22391).
|
|
|
|
| 1 |
"""Epicure Explorer: chef-facing operators over the three sibling embeddings.
|
| 2 |
|
| 3 |
+
Eight tabs:
|
| 4 |
+
- Basket pairings (with pairwise cosine heatmap of the basket itself)
|
| 5 |
+
- Supervised SLERP
|
| 6 |
+
- Emergent SLERP
|
| 7 |
+
- Arithmetic (Mikolov-style)
|
| 8 |
+
- Mode atlas (filter + search the GMM mode atlas)
|
| 9 |
+
- Compare siblings (same query, three columns)
|
| 10 |
+
- UMAP visualisation (Plotly scatter coloured by food group, basket highlighted)
|
| 11 |
+
- Parse my fridge (paste free-text ingredient list, fuzzy-match to canonical vocab)
|
| 12 |
+
|
| 13 |
Paper: https://arxiv.org/abs/2605.22391
|
| 14 |
"""
|
| 15 |
|
| 16 |
from __future__ import annotations
|
| 17 |
|
| 18 |
import os
|
| 19 |
+
import re
|
| 20 |
import sys
|
| 21 |
+
import json
|
| 22 |
import numpy as np
|
| 23 |
import gradio as gr
|
| 24 |
+
import plotly.graph_objects as go
|
| 25 |
|
| 26 |
try:
|
| 27 |
from epicure import Epicure
|
|
|
|
| 31 |
sys.path.insert(0, os.path.dirname(epicure_py))
|
| 32 |
from epicure import Epicure
|
| 33 |
|
| 34 |
+
from rapidfuzz import process as fuzz_process, fuzz as fuzz_scorers
|
| 35 |
+
|
| 36 |
MODELS = {
|
| 37 |
"cooc": Epicure.from_pretrained("Kaikaku/epicure-cooc"),
|
| 38 |
"core": Epicure.from_pretrained("Kaikaku/epicure-core"),
|
|
|
|
| 40 |
}
|
| 41 |
ALL_INGREDIENTS = sorted(MODELS["cooc"].vocab.keys())
|
| 42 |
|
| 43 |
+
# Load precomputed UMAP coords + food-group labels
|
| 44 |
+
_HERE = os.path.dirname(os.path.abspath(__file__))
|
| 45 |
+
UMAP = np.load(os.path.join(_HERE, "umap_2d.npz")) # keys: cooc, core, chem ; (1790, 2)
|
| 46 |
+
_lab = json.load(open(os.path.join(_HERE, "ingredient_labels.json")))
|
| 47 |
+
NAMES_BY_IDX = _lab["names"]
|
| 48 |
+
FOOD_GROUPS = _lab["food_groups"]
|
| 49 |
+
|
| 50 |
+
FG_COLORS = {
|
| 51 |
+
"Vegetable": "#2ca02c",
|
| 52 |
+
"Fruit": "#e377c2",
|
| 53 |
+
"Grain": "#bcbd22",
|
| 54 |
+
"Dairy": "#17becf",
|
| 55 |
+
"Spice": "#d62728",
|
| 56 |
+
"Pantry": "#ff7f0e",
|
| 57 |
+
"Beverage": "#9467bd",
|
| 58 |
+
"Other": "#888888",
|
| 59 |
+
}
|
| 60 |
+
|
| 61 |
# ===== math helpers =====
|
| 62 |
|
| 63 |
def _unit(v: np.ndarray, eps: float = 1e-9) -> np.ndarray:
|
| 64 |
n = np.linalg.norm(v); return v / max(n, eps)
|
| 65 |
|
| 66 |
+
def _basket_centroid(m, names):
|
| 67 |
valid = [n for n in (names or []) if n in m.vocab]
|
| 68 |
+
if not valid: return None
|
| 69 |
+
return _unit(m.E[[m.vocab[n] for n in valid]].mean(axis=0))
|
|
|
|
|
|
|
| 70 |
|
| 71 |
+
def _stack_directions(m, keys, use_factor_pole=False):
|
| 72 |
poles = []
|
| 73 |
for k in keys or []:
|
| 74 |
if use_factor_pole:
|
|
|
|
| 78 |
else:
|
| 79 |
if k in m.supervised_poles:
|
| 80 |
poles.append(_unit(m.supervised_poles[k]))
|
| 81 |
+
if not poles: return None
|
|
|
|
| 82 |
return _unit(np.stack(poles, axis=0).sum(axis=0))
|
| 83 |
|
| 84 |
+
def _topk(m, q, k, exclude):
|
| 85 |
sims = m.E @ q
|
| 86 |
+
for n in exclude or []:
|
| 87 |
+
if n in m.vocab: sims[m.vocab[n]] = -np.inf
|
|
|
|
| 88 |
order = np.argsort(-sims)
|
| 89 |
return [(m.itos[int(i)], float(sims[i])) for i in order[:k]]
|
| 90 |
|
| 91 |
+
def _supervised_choices(sibling):
|
| 92 |
return sorted(MODELS[sibling].supervised_poles.keys())
|
| 93 |
|
| 94 |
+
def _factor_mode_choices(sibling):
|
| 95 |
return [(f"{m.label} ({m.mode_id})", m.mode_id) for m in MODELS[sibling].modes if m.kind == "factor"]
|
| 96 |
|
| 97 |
+
def _slerp(m, v, d, theta_deg):
|
| 98 |
d_perp = d - (d @ v) * v
|
| 99 |
+
n = np.linalg.norm(d_perp)
|
| 100 |
+
if n < 1e-9: return v
|
| 101 |
+
d_perp = d_perp / n
|
|
|
|
| 102 |
th = np.deg2rad(float(theta_deg))
|
| 103 |
+
return _unit(np.cos(th)*v + np.sin(th)*d_perp)
|
|
|
|
| 104 |
|
| 105 |
# ===== tab handlers =====
|
| 106 |
|
| 107 |
+
def basket_pairings(sibling, basket, k):
|
| 108 |
m = MODELS[sibling]
|
| 109 |
centroid = _basket_centroid(m, basket)
|
| 110 |
if centroid is None:
|
| 111 |
+
return [], [], None
|
| 112 |
+
nb = _topk(m, centroid, k, exclude=basket or [])
|
| 113 |
scored = [(mode.mode_id, mode.label, mode.kind, float(_unit(mode.pole) @ centroid)) for mode in m.modes]
|
| 114 |
scored.sort(key=lambda x: -x[3])
|
| 115 |
+
heatmap = _basket_heatmap(m, basket)
|
| 116 |
return (
|
| 117 |
[[name, f"{sim:.4f}"] for name, sim in nb],
|
| 118 |
[[mid, label, kind, f"{sim:.4f}"] for mid, label, kind, sim in scored[:k]],
|
| 119 |
+
heatmap,
|
| 120 |
+
)
|
| 121 |
+
|
| 122 |
+
def _basket_heatmap(m, basket):
|
| 123 |
+
valid = [n for n in (basket or []) if n in m.vocab]
|
| 124 |
+
if len(valid) < 2:
|
| 125 |
+
return None
|
| 126 |
+
idxs = [m.vocab[n] for n in valid]
|
| 127 |
+
sub = m.E[idxs] # already L2-normalised
|
| 128 |
+
sim = sub @ sub.T
|
| 129 |
+
fig = go.Figure(go.Heatmap(
|
| 130 |
+
z=sim, x=valid, y=valid,
|
| 131 |
+
colorscale="Viridis", zmin=-0.2, zmax=1.0,
|
| 132 |
+
colorbar=dict(title="cos"),
|
| 133 |
+
hovertemplate="%{y} <> %{x}<br>cos = %{z:.3f}<extra></extra>",
|
| 134 |
+
))
|
| 135 |
+
fig.update_layout(
|
| 136 |
+
title="Pairwise cosine between basket members",
|
| 137 |
+
height=420, width=520,
|
| 138 |
+
margin=dict(l=80, r=20, t=50, b=80),
|
| 139 |
)
|
| 140 |
+
return fig
|
| 141 |
|
| 142 |
+
def supervised_slerp_multi(sibling, basket, directions, theta, k):
|
| 143 |
m = MODELS[sibling]
|
| 144 |
v = _basket_centroid(m, basket)
|
| 145 |
+
if v is None: return []
|
| 146 |
d = _stack_directions(m, directions, use_factor_pole=False)
|
|
|
|
|
|
|
| 147 |
if d is None:
|
| 148 |
return [[n, f"{s:.4f}"] for n, s in _topk(m, v, k, basket)]
|
| 149 |
q = _slerp(m, v, d, theta)
|
| 150 |
+
return [[n, f"{s:.4f}"] for n, s in _topk(m, q, k, basket)]
|
| 151 |
|
| 152 |
+
def emergent_slerp_multi(sibling, basket, mode_labels, theta, k):
|
| 153 |
m = MODELS[sibling]
|
| 154 |
label_to_id = {f"{mode.label} ({mode.mode_id})": mode.mode_id for mode in m.modes if mode.kind == "factor"}
|
| 155 |
mode_ids = [label_to_id[lab] for lab in (mode_labels or []) if lab in label_to_id]
|
| 156 |
v = _basket_centroid(m, basket)
|
| 157 |
+
if v is None: return []
|
| 158 |
d = _stack_directions(m, mode_ids, use_factor_pole=True)
|
|
|
|
|
|
|
| 159 |
if d is None:
|
| 160 |
return [[n, f"{s:.4f}"] for n, s in _topk(m, v, k, basket)]
|
| 161 |
q = _slerp(m, v, d, theta)
|
| 162 |
+
return [[n, f"{s:.4f}"] for n, s in _topk(m, q, k, basket)]
|
| 163 |
|
| 164 |
+
def arithmetic(sibling, positives, negatives, k):
|
| 165 |
m = MODELS[sibling]
|
| 166 |
pos = _basket_centroid(m, positives)
|
| 167 |
+
if pos is None: return []
|
|
|
|
| 168 |
neg = _basket_centroid(m, negatives) if negatives else None
|
| 169 |
q = _unit(pos - neg) if neg is not None else pos
|
| 170 |
+
return [[n, f"{s:.4f}"] for n, s in _topk(m, q, k, (positives or []) + (negatives or []))]
|
| 171 |
|
| 172 |
+
def browse_modes(sibling, kind_filter, query):
|
| 173 |
m = MODELS[sibling]
|
| 174 |
+
rows, q = [], (query or "").strip().lower()
|
|
|
|
| 175 |
for mode in m.modes:
|
| 176 |
if kind_filter != "all" and mode.kind != kind_filter:
|
| 177 |
continue
|
| 178 |
if q and q not in mode.label.lower() and q not in mode.property.lower():
|
| 179 |
continue
|
| 180 |
+
rows.append([mode.mode_id, mode.kind, mode.property, mode.label, mode.n_members, ", ".join(mode.members[:12])])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 181 |
rows.sort(key=lambda r: (r[1], -r[4]))
|
| 182 |
return rows
|
| 183 |
|
| 184 |
+
def compare_siblings(basket, directions, theta, k):
|
| 185 |
out = []
|
| 186 |
+
for sib in ["cooc","core","chem"]:
|
| 187 |
m = MODELS[sib]
|
| 188 |
v = _basket_centroid(m, basket)
|
| 189 |
if v is None:
|
| 190 |
out.append([]); continue
|
|
|
|
| 191 |
valid_dirs = [d for d in (directions or []) if d in m.supervised_poles]
|
| 192 |
if valid_dirs:
|
| 193 |
d_vec = _stack_directions(m, valid_dirs)
|
|
|
|
| 195 |
else:
|
| 196 |
q = v
|
| 197 |
hits = _topk(m, q, k=k, exclude=basket)
|
| 198 |
+
out.append([[n, f"{s:.4f}"] for n, s in hits])
|
| 199 |
return out[0], out[1], out[2]
|
| 200 |
|
| 201 |
+
def umap_view(sibling, basket, show_neighbours, k):
|
| 202 |
+
coords = UMAP[sibling] # (1790, 2)
|
| 203 |
+
m = MODELS[sibling]
|
| 204 |
+
name_to_idx = m.vocab
|
| 205 |
+
|
| 206 |
+
fig = go.Figure()
|
| 207 |
+
|
| 208 |
+
# Background scatter coloured by food group
|
| 209 |
+
by_group = {}
|
| 210 |
+
for i, fg in enumerate(FOOD_GROUPS):
|
| 211 |
+
by_group.setdefault(fg, []).append(i)
|
| 212 |
+
# Plot Other first so it sits behind the colourful groups
|
| 213 |
+
order = ["Other"] + [g for g in FG_COLORS if g != "Other"]
|
| 214 |
+
for fg in order:
|
| 215 |
+
if fg not in by_group: continue
|
| 216 |
+
idxs = by_group[fg]
|
| 217 |
+
fig.add_trace(go.Scatter(
|
| 218 |
+
x=coords[idxs, 0], y=coords[idxs, 1],
|
| 219 |
+
mode="markers",
|
| 220 |
+
name=fg,
|
| 221 |
+
marker=dict(
|
| 222 |
+
size=5, color=FG_COLORS.get(fg, "#888888"),
|
| 223 |
+
opacity=0.35 if fg == "Other" else 0.55,
|
| 224 |
+
line=dict(width=0),
|
| 225 |
+
),
|
| 226 |
+
text=[NAMES_BY_IDX[i] for i in idxs],
|
| 227 |
+
hovertemplate="%{text}<br>food group: " + fg + "<extra></extra>",
|
| 228 |
+
))
|
| 229 |
+
|
| 230 |
+
# Highlight the basket members (red, larger, with text labels)
|
| 231 |
+
if basket:
|
| 232 |
+
bi = [name_to_idx[b] for b in basket if b in name_to_idx]
|
| 233 |
+
if bi:
|
| 234 |
+
fig.add_trace(go.Scatter(
|
| 235 |
+
x=coords[bi, 0], y=coords[bi, 1],
|
| 236 |
+
mode="markers+text",
|
| 237 |
+
name="Basket",
|
| 238 |
+
marker=dict(size=14, color="#e30613", symbol="star", line=dict(color="white", width=1.5)),
|
| 239 |
+
text=[NAMES_BY_IDX[i] for i in bi],
|
| 240 |
+
textposition="top center",
|
| 241 |
+
textfont=dict(size=12, color="#000000"),
|
| 242 |
+
hovertemplate="<b>%{text}</b><extra></extra>",
|
| 243 |
+
))
|
| 244 |
+
|
| 245 |
+
# Optionally show top-K neighbours of the basket centroid
|
| 246 |
+
if show_neighbours:
|
| 247 |
+
centroid = _basket_centroid(m, basket)
|
| 248 |
+
if centroid is not None:
|
| 249 |
+
nb_pairs = _topk(m, centroid, k=int(k), exclude=basket)
|
| 250 |
+
nb_idxs = [name_to_idx[n] for n, _ in nb_pairs if n in name_to_idx]
|
| 251 |
+
if nb_idxs:
|
| 252 |
+
fig.add_trace(go.Scatter(
|
| 253 |
+
x=coords[nb_idxs, 0], y=coords[nb_idxs, 1],
|
| 254 |
+
mode="markers+text",
|
| 255 |
+
name=f"Top-{k} neighbours",
|
| 256 |
+
marker=dict(size=9, color="#ff8800", symbol="circle", line=dict(color="white", width=1)),
|
| 257 |
+
text=[NAMES_BY_IDX[i] for i in nb_idxs],
|
| 258 |
+
textposition="top center",
|
| 259 |
+
textfont=dict(size=10, color="#444444"),
|
| 260 |
+
hovertemplate="<b>%{text}</b> (neighbour)<extra></extra>",
|
| 261 |
+
))
|
| 262 |
+
|
| 263 |
+
fig.update_layout(
|
| 264 |
+
title=f"UMAP of Epicure-{sibling.capitalize()} (cosine, n_neighbors=30, min_dist=0.03)",
|
| 265 |
+
xaxis_title="UMAP 1", yaxis_title="UMAP 2",
|
| 266 |
+
height=650, width=900,
|
| 267 |
+
legend=dict(orientation="v", x=1.02, y=1, font=dict(size=11)),
|
| 268 |
+
margin=dict(l=60, r=160, t=70, b=60),
|
| 269 |
+
plot_bgcolor="#ffffff",
|
| 270 |
+
)
|
| 271 |
+
fig.update_xaxes(showgrid=True, gridcolor="#eee", zeroline=False)
|
| 272 |
+
fig.update_yaxes(showgrid=True, gridcolor="#eee", zeroline=False)
|
| 273 |
+
return fig
|
| 274 |
+
|
| 275 |
+
|
| 276 |
+
_LINE_SPLIT = re.compile(r"[\n;]")
|
| 277 |
+
_BRACKET = re.compile(r"\([^)]*\)")
|
| 278 |
+
|
| 279 |
+
# Number or word number
|
| 280 |
+
_QTY = (
|
| 281 |
+
r"(?:\d+(?:[\.,/]\d+)?|"
|
| 282 |
+
r"a|an|one|two|three|four|five|six|seven|eight|nine|ten|half|quarter)"
|
| 283 |
+
)
|
| 284 |
+
# Units (word-boundary protected so 'g' does NOT eat the 'g' in 'ginger')
|
| 285 |
+
_UNIT = (
|
| 286 |
+
r"(?:cups?|tbsp\.?|tablespoons?|tsp\.?|teaspoons?|"
|
| 287 |
+
r"oz\.?|ounces?|lbs?\.?|pounds?|grams?|kgs?|kilos?|"
|
| 288 |
+
r"ml|liters?|litres?|cloves?|bunches?|sprigs?|pinch(?:es)?|"
|
| 289 |
+
r"slices?|pieces?|cans?|packets?|sticks?|leaves?|stalks?|heads?|inch(?:es)?|"
|
| 290 |
+
r"splash(?:es)?|dash(?:es)?|drops?|handfuls?|large|small|medium)"
|
| 291 |
+
)
|
| 292 |
+
_LEADING_QTY = re.compile(rf"^\s*{_QTY}\s+(?:{_UNIT}\b\s*)?(?:of\s+)?", re.IGNORECASE)
|
| 293 |
+
_LEADING_UNIT_ONLY = re.compile(rf"^\s*{_UNIT}\b\s*(?:of\s+)?", re.IGNORECASE)
|
| 294 |
+
_JUICE_OF = re.compile(rf"^\s*(?:juice|zest)\s+(?:of\s+)?(?:{_QTY}\s+)?", re.IGNORECASE)
|
| 295 |
+
_LEADING_PREP = re.compile(
|
| 296 |
+
r"^\s*(?:fresh|dried|cooked|frozen|raw|ripe|firm|boneless|skinless|smoked|low[- ]fat)\s+",
|
| 297 |
+
re.IGNORECASE,
|
| 298 |
+
)
|
| 299 |
+
# Trailing prep: only after a comma (so 'boneless chicken thighs' is not nuked)
|
| 300 |
+
_TRAILING_PREP = re.compile(
|
| 301 |
+
r"\s*,\s*(?:chopped|minced|diced|sliced|grated|crushed|whole|ground|peeled|"
|
| 302 |
+
r"to taste|optional|finely|coarsely|cubed|shredded|julienned|halved|quartered|warmed|"
|
| 303 |
+
r"toasted|roasted|bruised|melted|softened|cooked|drained|rinsed|patted dry|trimmed|"
|
| 304 |
+
r"deveined|seeded|stemmed|crumbled).*$",
|
| 305 |
+
re.IGNORECASE,
|
| 306 |
+
)
|
| 307 |
+
# Some plural -> singular forms we hand-massage before fuzzy lookup
|
| 308 |
+
_KNOWN_PLURALS = {
|
| 309 |
+
"tortillas": "tortilla",
|
| 310 |
+
"thighs": "thigh",
|
| 311 |
+
"leaves": "leaf",
|
| 312 |
+
"onions": "onion",
|
| 313 |
+
"potatoes": "potato",
|
| 314 |
+
"tomatoes": "tomato",
|
| 315 |
+
"cloves": "clove",
|
| 316 |
+
}
|
| 317 |
+
|
| 318 |
+
def _clean_line(line: str) -> str:
|
| 319 |
+
s = line.strip().lower()
|
| 320 |
+
s = _BRACKET.sub(" ", s)
|
| 321 |
+
if "juice" in s or "zest" in s:
|
| 322 |
+
s = _JUICE_OF.sub("", s)
|
| 323 |
+
s = _TRAILING_PREP.sub("", s)
|
| 324 |
+
s = _LEADING_QTY.sub("", s)
|
| 325 |
+
s = _LEADING_UNIT_ONLY.sub("", s)
|
| 326 |
+
s = _LEADING_PREP.sub("", s)
|
| 327 |
+
# Run the leading-prep / unit cleanup once more to catch chains like "fresh whole bean"
|
| 328 |
+
s = _LEADING_PREP.sub("", s)
|
| 329 |
+
# Hand-massage common plurals so 'tortillas' fuzzy-matches 'tortilla' / 'corn_tortilla' better
|
| 330 |
+
tokens = s.split()
|
| 331 |
+
tokens = [_KNOWN_PLURALS.get(t, t) for t in tokens]
|
| 332 |
+
s = " ".join(tokens)
|
| 333 |
+
s = re.sub(r"\s+", " ", s).strip()
|
| 334 |
+
return s
|
| 335 |
+
|
| 336 |
+
def _fuzzy_lookup(cleaned: str, vocab: list[str], vocab_sp: list[str], min_score: int):
|
| 337 |
+
"""Pick the best canonical match across three scorers, breaking ties by canonical-name length."""
|
| 338 |
+
if not cleaned:
|
| 339 |
+
return None, 0.0
|
| 340 |
+
candidates = []
|
| 341 |
+
for scorer in (fuzz_scorers.token_set_ratio, fuzz_scorers.WRatio, fuzz_scorers.partial_ratio):
|
| 342 |
+
hits = fuzz_process.extract(cleaned, vocab_sp, scorer=scorer, score_cutoff=min_score, limit=10)
|
| 343 |
+
for _name_sp, score, idx in hits:
|
| 344 |
+
candidates.append((vocab[idx], float(score)))
|
| 345 |
+
if not candidates:
|
| 346 |
+
return None, 0.0
|
| 347 |
+
# Tie-break: higher score first, then longer canonical name (prefer 'fish_sauce' over 'fish').
|
| 348 |
+
# We also prefer canonical names whose token-set is a subset of the input (avoid 'black_garlic' for 'garlic').
|
| 349 |
+
def tokens(name): return set(name.replace("_"," ").split())
|
| 350 |
+
cleaned_tokens = set(cleaned.split())
|
| 351 |
+
def rank_key(c):
|
| 352 |
+
name, score = c
|
| 353 |
+
nt = tokens(name)
|
| 354 |
+
# 0 if all canonical tokens appear in input, 1 if not (penalty)
|
| 355 |
+
extra_penalty = 0 if nt.issubset(cleaned_tokens) else 1
|
| 356 |
+
return (-score, extra_penalty, -len(name))
|
| 357 |
+
candidates.sort(key=rank_key)
|
| 358 |
+
return candidates[0]
|
| 359 |
+
|
| 360 |
+
def parse_fridge(raw_text: str, sibling: str, min_score: int = 70):
|
| 361 |
+
if not raw_text or not raw_text.strip():
|
| 362 |
+
return [], []
|
| 363 |
+
vocab = list(MODELS[sibling].vocab.keys())
|
| 364 |
+
vocab_sp = [v.replace("_", " ") for v in vocab]
|
| 365 |
+
rows, matched_set = [], []
|
| 366 |
+
for line in _LINE_SPLIT.split(raw_text):
|
| 367 |
+
if not line.strip(): continue
|
| 368 |
+
cleaned = _clean_line(line)
|
| 369 |
+
if not cleaned:
|
| 370 |
+
rows.append([line.strip(), "(empty after cleaning)", 0.0, ""])
|
| 371 |
+
continue
|
| 372 |
+
match, score = _fuzzy_lookup(cleaned, vocab, vocab_sp, int(min_score))
|
| 373 |
+
if match is None:
|
| 374 |
+
# last-ditch: drop the last token (handles 'tortillas warmed' -> 'tortillas')
|
| 375 |
+
tokens = cleaned.split()
|
| 376 |
+
if len(tokens) > 1:
|
| 377 |
+
match, score = _fuzzy_lookup(" ".join(tokens[:-1]), vocab, vocab_sp, int(min_score))
|
| 378 |
+
if match is None:
|
| 379 |
+
rows.append([line.strip(), "(no match)", 0.0, cleaned])
|
| 380 |
+
continue
|
| 381 |
+
rows.append([line.strip(), match, round(score, 1), cleaned])
|
| 382 |
+
matched_set.append(match)
|
| 383 |
+
seen, dedup = set(), []
|
| 384 |
+
for n in matched_set:
|
| 385 |
+
if n not in seen:
|
| 386 |
+
seen.add(n); dedup.append(n)
|
| 387 |
+
return rows, dedup
|
| 388 |
+
|
| 389 |
|
| 390 |
# ===== UI =====
|
| 391 |
|
|
|
|
| 400 |
- **Core** blends typed FlavorDB compound walks with injected I-I walks. Concentrated geometry, tightest modes.
|
| 401 |
- **Chem** walks typed FlavorDB compound metapaths only. Strongest supervised-direction recovery; neighbours are flavour-profile peers.
|
| 402 |
|
| 403 |
+
Pick a sibling, then explore. Each operator tab has worked examples below the form (click any row to populate inputs).
|
| 404 |
"""
|
| 405 |
)
|
| 406 |
|
| 407 |
+
sibling = gr.Radio(choices=["cooc","core","chem"], value="chem", label="Sibling embedding")
|
| 408 |
|
| 409 |
+
# ---------- Tab 1: Basket pairings + heatmap ----------
|
| 410 |
with gr.Tab("Basket pairings"):
|
| 411 |
gr.Markdown(
|
| 412 |
+
"Pick one or more ingredients. Tool averages their unit vectors and returns nearest neighbours "
|
| 413 |
+
"plus closest modes of that centroid. The heatmap on the right shows how related the basket "
|
| 414 |
+
"members already are to each other -- a coherent basket has bright off-diagonals, a scattered "
|
| 415 |
+
"basket has dark ones."
|
| 416 |
)
|
| 417 |
basket = gr.Dropdown(
|
| 418 |
choices=ALL_INGREDIENTS, value=["chicken","lemon","garlic"],
|
|
|
|
| 423 |
with gr.Row():
|
| 424 |
nb_table = gr.Dataframe(headers=["Neighbour","Cosine"], label="Top-K nearest neighbours", interactive=False)
|
| 425 |
mode_table = gr.Dataframe(headers=["Mode id","Label","Kind","Cosine"], label="Closest modes", interactive=False)
|
| 426 |
+
heatmap_plot = gr.Plot(label="Pairwise cosine within the basket")
|
| 427 |
+
pair_btn.click(
|
| 428 |
+
basket_pairings,
|
| 429 |
+
inputs=[sibling, basket, k_pair],
|
| 430 |
+
outputs=[nb_table, mode_table, heatmap_plot],
|
| 431 |
+
)
|
| 432 |
gr.Examples(
|
| 433 |
examples=[
|
| 434 |
["chem", ["chicken","lemon","garlic"], 8],
|
|
|
|
| 447 |
# ---------- Tab 2: Supervised SLERP ----------
|
| 448 |
with gr.Tab("Supervised SLERP"):
|
| 449 |
gr.Markdown(
|
| 450 |
+
"Rotate the seed basket toward one or more supervised direction poles. Multiple directions "
|
| 451 |
+
"are summed and L2-normalised before rotation, matching the paper's multi-constraint queries."
|
|
|
|
| 452 |
)
|
| 453 |
sup_basket = gr.Dropdown(
|
| 454 |
choices=ALL_INGREDIENTS, value=["rice"],
|
|
|
|
| 464 |
sup_btn = gr.Button("Rotate", variant="primary")
|
| 465 |
sup_table = gr.Dataframe(headers=["Ingredient","Cosine"], label="Top-K rotated-query neighbours")
|
| 466 |
sup_btn.click(supervised_slerp_multi, inputs=[sibling, sup_basket, sup_dirs, sup_theta, sup_k], outputs=sup_table)
|
| 467 |
+
sibling.change(lambda s: gr.Dropdown(choices=_supervised_choices(s), value=[]), inputs=sibling, outputs=sup_dirs)
|
|
|
|
|
|
|
|
|
|
| 468 |
gr.Examples(
|
| 469 |
examples=[
|
| 470 |
["chem", ["rice"], ["cuisine:South_Asian"], 30, 8],
|
|
|
|
| 500 |
em_btn = gr.Button("Rotate", variant="primary")
|
| 501 |
em_table = gr.Dataframe(headers=["Ingredient","Cosine"], label="Top-K rotated-query neighbours")
|
| 502 |
em_btn.click(emergent_slerp_multi, inputs=[sibling, em_basket, em_modes, em_theta, em_k], outputs=em_table)
|
| 503 |
+
sibling.change(lambda s: gr.Dropdown(choices=[label for label, _ in _factor_mode_choices(s)], value=[]), inputs=sibling, outputs=em_modes)
|
|
|
|
|
|
|
|
|
|
| 504 |
|
| 505 |
# ---------- Tab 4: Arithmetic ----------
|
| 506 |
with gr.Tab("Arithmetic"):
|
| 507 |
gr.Markdown(
|
| 508 |
"Classic Mikolov-style vector arithmetic: `centroid(positives) - centroid(negatives)`, "
|
| 509 |
+
"then top-K nearest neighbours. The killer demo is `miso - salt` on Core: returns the "
|
| 510 |
+
"Japanese fermented-umami pantry minus the salty component (mirin, kombu, wakame, sake, dashi)."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 511 |
)
|
| 512 |
+
pos_box = gr.Dropdown(choices=ALL_INGREDIENTS, value=["miso"], label="Positives", multiselect=True, max_choices=10)
|
| 513 |
+
neg_box = gr.Dropdown(choices=ALL_INGREDIENTS, value=["salt"], label="Negatives", multiselect=True, max_choices=10)
|
| 514 |
ar_k = gr.Slider(1, 15, value=8, step=1, label="K")
|
| 515 |
ar_btn = gr.Button("Compute", variant="primary")
|
| 516 |
ar_table = gr.Dataframe(headers=["Ingredient","Cosine"], label="Top-K nearest to result vector")
|
|
|
|
| 530 |
label="Try one of these arithmetic queries",
|
| 531 |
)
|
| 532 |
|
| 533 |
+
# ---------- Tab 5: Mode atlas ----------
|
| 534 |
with gr.Tab("Mode atlas"):
|
| 535 |
gr.Markdown(
|
| 536 |
+
"Browse the GMM mode atlas of the selected sibling (Cooc 150 / Core 193 / Chem 200 modes). "
|
| 537 |
+
"`factor` = emergent FastICA modes; `continuous` = quartile partitions of NOVA/sensory/USDA; "
|
| 538 |
+
"`binary` = food-group buckets. Search by label or property substring."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 539 |
)
|
| 540 |
+
atlas_kind = gr.Radio(choices=["all","factor","continuous","binary"], value="all", label="Mode kind")
|
| 541 |
+
atlas_search = gr.Textbox(label="Search labels / properties", placeholder="e.g. South Asian, baking, fiber", value="")
|
| 542 |
atlas_btn = gr.Button("Browse modes", variant="primary")
|
| 543 |
atlas_table = gr.Dataframe(
|
| 544 |
headers=["mode_id","kind","property","label","n_members","top members"],
|
|
|
|
| 550 |
# ---------- Tab 6: Compare siblings ----------
|
| 551 |
with gr.Tab("Compare siblings"):
|
| 552 |
gr.Markdown(
|
| 553 |
+
"Same query, three siblings, side-by-side. The chemistry-vs-recipe-context spectrum visible in one screen."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 554 |
)
|
| 555 |
+
cmp_basket = gr.Dropdown(choices=ALL_INGREDIENTS, value=["chicken"], label="Seed basket", multiselect=True, max_choices=10)
|
| 556 |
cmp_dirs = gr.Dropdown(
|
| 557 |
choices=_supervised_choices("chem"), value=[],
|
| 558 |
+
label="Optional directions (leave empty for pure pairings)",
|
| 559 |
multiselect=True, max_choices=5,
|
| 560 |
)
|
| 561 |
cmp_theta = gr.Slider(0, 90, value=30, step=5, label="Rotation angle (deg; ignored if no directions)")
|
|
|
|
| 565 |
cmp_cooc = gr.Dataframe(headers=["Cooc neighbour","Cosine"], label="Cooc (recipe-context)")
|
| 566 |
cmp_core = gr.Dataframe(headers=["Core neighbour","Cosine"], label="Core (blended)")
|
| 567 |
cmp_chem = gr.Dataframe(headers=["Chem neighbour","Cosine"], label="Chem (chemistry)")
|
| 568 |
+
cmp_btn.click(compare_siblings, inputs=[cmp_basket, cmp_dirs, cmp_theta, cmp_k], outputs=[cmp_cooc, cmp_core, cmp_chem])
|
|
|
|
|
|
|
|
|
|
|
|
|
| 569 |
gr.Examples(
|
| 570 |
examples=[
|
| 571 |
[["chicken"], [], 0, 8],
|
|
|
|
| 579 |
label="Try one of these side-by-side comparisons",
|
| 580 |
)
|
| 581 |
|
| 582 |
+
# ---------- Tab 7: UMAP visualisation ----------
|
| 583 |
+
with gr.Tab("UMAP visualisation"):
|
| 584 |
+
gr.Markdown(
|
| 585 |
+
"2-D UMAP projection of the 1,790-ingredient embedding (cosine metric, "
|
| 586 |
+
"n_neighbors=30, min_dist=0.03 -- the paper's Figure 1 hyperparameters). "
|
| 587 |
+
"Points coloured by food group when known. Add ingredients to the basket to highlight "
|
| 588 |
+
"them as red stars, and optionally show their nearest neighbours as orange circles."
|
| 589 |
+
)
|
| 590 |
+
umap_basket = gr.Dropdown(
|
| 591 |
+
choices=ALL_INGREDIENTS, value=["chicken","lemon","garlic"],
|
| 592 |
+
label="Highlight these ingredients", multiselect=True, max_choices=10,
|
| 593 |
+
)
|
| 594 |
+
with gr.Row():
|
| 595 |
+
umap_show_nb = gr.Checkbox(value=True, label="Also show top-K neighbours of the basket centroid")
|
| 596 |
+
umap_k = gr.Slider(1, 20, value=10, step=1, label="K neighbours to draw")
|
| 597 |
+
umap_btn = gr.Button("Plot UMAP", variant="primary")
|
| 598 |
+
umap_plot = gr.Plot(label="UMAP")
|
| 599 |
+
umap_btn.click(umap_view, inputs=[sibling, umap_basket, umap_show_nb, umap_k], outputs=umap_plot)
|
| 600 |
+
|
| 601 |
+
# ---------- Tab 8: Parse my fridge ----------
|
| 602 |
+
with gr.Tab("Parse my fridge"):
|
| 603 |
+
gr.Markdown(
|
| 604 |
+
"Paste a free-text ingredient list (recipe lines, shopping list, fridge contents). "
|
| 605 |
+
"Tool strips quantities/units/prep notes and fuzzy-matches each line against the 1,790 canonical "
|
| 606 |
+
"vocab via rapidfuzz. Threshold defaults to 70 (out of 100); lower = more lenient. "
|
| 607 |
+
"Useful because chefs do not think in `corn_tortilla` -- they write `2 corn tortillas, warmed`."
|
| 608 |
+
)
|
| 609 |
+
fridge_text = gr.Textbox(
|
| 610 |
+
label="Free-text ingredients (one per line or semicolon-separated)",
|
| 611 |
+
lines=8,
|
| 612 |
+
placeholder=(
|
| 613 |
+
"2 boneless chicken thighs\n"
|
| 614 |
+
"1 cup coconut milk\n"
|
| 615 |
+
"1 tbsp fish sauce (or soy sauce)\n"
|
| 616 |
+
"fresh lemongrass, bruised\n"
|
| 617 |
+
"3 cloves garlic, minced\n"
|
| 618 |
+
"1 inch fresh ginger\n"
|
| 619 |
+
"juice of one lime\n"
|
| 620 |
+
"salt to taste"
|
| 621 |
+
),
|
| 622 |
+
)
|
| 623 |
+
fridge_min = gr.Slider(40, 100, value=70, step=5, label="Min match score (rapidfuzz WRatio)")
|
| 624 |
+
fridge_btn = gr.Button("Parse and match", variant="primary")
|
| 625 |
+
fridge_table = gr.Dataframe(
|
| 626 |
+
headers=["Input line", "Canonical match", "Score", "Cleaned"],
|
| 627 |
+
label="Parsed matches", interactive=False,
|
| 628 |
+
)
|
| 629 |
+
fridge_matched = gr.Textbox(label="Matched ingredients (paste into a Basket dropdown)", interactive=False)
|
| 630 |
+
def _parse(txt, sib, mn):
|
| 631 |
+
rows, matches = parse_fridge(txt, sib, int(mn))
|
| 632 |
+
return rows, ", ".join(matches)
|
| 633 |
+
fridge_btn.click(_parse, inputs=[fridge_text, sibling, fridge_min], outputs=[fridge_table, fridge_matched])
|
| 634 |
+
|
| 635 |
gr.Markdown(
|
| 636 |
"""---
|
| 637 |
**Cite:** Radzikowski and Chen, 2026, *Epicure: Navigating the Emergent Geometry of Food Ingredient Embeddings*, [arXiv:2605.22391](https://arxiv.org/abs/2605.22391).
|
ingredient_labels.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"names": ["abalone", "abalone_mushroom", "absinthe", "acacia", "acai", "acerola", "achiote_paste", "acorn", "acorn_squash", "activated_charcoal_powder", "adjika", "adobo_sauce", "adobo_seasoning", "advocaat", "agar", "agati_flower", "agave_syrup", "aguardiente", "aji_amarillo", "aji_panca", "ajvar", "ajwain", "alcaparrado", "aleppo_pepper", "alfalfa_sprout", "alfredo_sauce", "alligator", "allspice", "allulose", "almond", "almond_butter", "almond_milk", "almond_paste", "almond_tofu", "aloe_vera", "alum", "amaranth", "amaretti_cookie", "amaretto", "amaro", "amazake", "amberjack", "amchur", "american_cheese", "anaheim_chile", "anardana_powder", "ancho_chile", "anchovy", "andouille_sausage", "angelica_root", "anise", "anisette", "annatto_seed", "aonori", "apple", "apple_brandy", "apple_cider", "apple_cider_vinegar", "apple_pie_spice", "applewood_chip", "apricot", "apricot_brandy", "aquafaba", "aquavit", "arame", "arctic_char", "arepa", "argan_oil", "armagnac", "aronia_berry", "arrowhead", "arrowroot", "artichoke", "arugula", "asafoetida", "asam_gelugur", "ascorbic_acid", "asiago_cheese", "asian_pear", "asparagus", "astragalus_root", "avocado", "avocado_oil", "ayran", "bacon", "bagel", "baharat", "bai_ji_mo", "baijiu", "bak_kut_teh_spice", "baked_beans", "bakers_ammonia", "baking_powder", "baking_soda", "balado_seasoning", "balsamic_vinegar", "balut", "balyk", "bamboo_leaf", "bamboo_pith_mushroom", "bamboo_salt", "bamboo_shoot", "banana", "banana_blossom", "banana_leaf", "banana_pepper", "barbecue_sauce", "barbecue_seasoning", "barberry", "barley", "barley_grass", "barramundi", "basa", "basil", "basil_seed", "basmati_rice", "batang_fish", "bay_leaf", "bean", "bean_sprout", "bear_meat", "bearnaise_sauce", "bechamel", "bee_pollen", "beef", "beer", "beet", "bel_paese_cheese", "bell_pepper", "bellflower_root", "benedictine", "berbere", "bergamot", "berry", "bilimbi", "birds_eye_chili", "birds_nest", "biryani_masala", "biscotti", "biscuit", "bison", "bitter_almond", "bitter_green", "bitter_melon", "bitter_orange", "bittern", "bitters", "black_bean", "black_bean_paste", "black_currant", "black_eyed_pea", "black_garlic", "black_olive", "black_pepper", "black_rice", "black_salt", "black_sesame_seed", "black_tea", "black_treacle", "black_truffle", "black_vinegar", "blackberry", "blackening_seasoning", "blood_orange", "blood_sausage", "blood_tofu", "bloody_mary_mix", "blue_cheese", "blue_curacao", "blueberry", "bluefish", "bok_choy", "bolillo", "bolognese_sauce", "bombay_duck_fish", "bone", "bone_marrow", "bonito", "bonito_flakes", "borage", "borlotti_bean", "bottarga", "bottle_gourd", "bouquet_garni", "bourbon", "boursin_cheese", "boysenberry", "braising_liquid", "bran", "brandy", "branzino", "bratwurst", "braunschweiger", "brazil_nut", "bread", "bread_crumbs", "breadfruit", "bream", "bresaola", "brewers_yeast", "brick_cheese", "brick_tea", "brie_cheese", "brine", "brioche", "broccoli", "broccoli_rabe", "broccolini", "broth", "brown_rice", "brown_sauce", "brown_sugar", "browning_sauce", "brussels_sprout", "bryndza", "buckwheat", "budae_jjigae_base", "buffalo_meat", "buffalo_milk", "buffalo_wing_sauce", "buldak_sauce", "bulgogi", "bulgur", "burdock_root", "burrata", "butifarra", "butter", "buttercream", "butterfish", "butterfly_pea_flower", "buttermilk", "butternut_squash", "butterscotch", "cabbage", "cacao", "cachaca", "caciocavallo", "caesar_dressing", "cajeta", "cajun_seasoning", "calabrian_chili", "calamansi", "calcium_chloride", "calendula", "calpis", "calvados", "camellia_oil", "camembert_cheese", "campari", "canadian_bacon", "candied_fruit", "candlenut", "candy", "candy_coating", "cane_syrup", "cane_vinegar", "cannellini_bean", "cannoli_shell", "canola_oil", "cantal_cheese", "cantaloupe", "cape_gooseberry", "capelin", "caper", "caperberry", "capicola", "capon", "caramel", "caraway_seed", "cardamom", "cardoon", "carob", "carob_molasses", "carp", "carrageenan", "carrot", "carrot_top", "cartilage", "cascabel_chile", "cashew", "cassava", "catfish", "catnip", "cattail", "caul_fat", "cauliflower", "cava", "caviar", "cayenne_pepper", "celeriac", "celery", "celery_seed", "celtuce", "century_egg", "cereal", "chaat_masala", "chai_spice", "chamomile", "champagne", "champagne_vinegar", "chana_dal", "chanterelle_mushroom", "chaozhou_salted_vegetable", "char_siu_pork", "char_siu_sauce", "chartreuse", "chayote", "cheddar_cheese", "cheese", "cheongyang_chili", "cherry", "cherry_blossom", "cherry_leaf", "cherry_liqueur", "cherry_pepper", "cherry_plum", "chervil", "cheshire_cheese", "chestnut", "chia_seed", "chicha", "chicken", "chicken_broth", "chicken_fat", "chickpea", "chicory", "chihuahua_cheese", "chikuwa", "chile_de_arbol", "chili_garlic_sauce", "chili_oil", "chili_paste", "chili_pepper", "chili_powder", "chili_sauce", "chiltepin", "chinese_bayberry", "chinese_broccoli", "chinese_celery", "chinese_cured_pork", "chinese_preserved_olive", "chinese_sausage", "chinese_toon", "chinese_yam", "chipotle_pepper", "chirimen_jako", "chive", "chive_flower", "chocolate", "chocolate_hazelnut_spread", "chocolate_liqueur", "chokecherry", "choricero_pepper", "chorizo", "choux_pastry", "choy_sum", "chrysanthemum", "chu_hou_paste", "chunjang", "chuno", "chutney", "ciabatta", "cicada", "cinnamon", "cipollini_onion", "citric_acid", "citron", "citrus", "clam", "clamato_juice", "clay_pot_rice_sauce", "clear_gel", "clementine", "clotted_cream", "clove", "clover", "club_soda", "cobia", "cockle", "cocktail_sauce", "cocoa_butter", "cocoa_mass", "cocoa_powder", "coconut", "coconut_aminos", "coconut_cream", "coconut_liqueur", "coconut_milk", "coconut_oil", "coconut_sugar", "coconut_vinegar", "coconut_water", "cod", "cod_liver", "coffee", "coffee_creamer", "coffee_liqueur", "cognac", "coix_seed", "cola", "colby_cheese", "cold_jelly_noodle", "collard_green", "comte_cheese", "conch", "condensed_milk", "consomme", "cookie", "cookie_butter", "cooking_spray", "copha", "cordyceps_flower", "coriander", "coriander_root", "corn", "corn_flakes", "corn_husk", "corn_oil", "corn_relish", "corn_silk", "corn_syrup", "corn_tortilla", "cornbread", "corned_beef", "cornelian_cherry", "cornmeal", "cornstarch", "corvina", "cotija_cheese", "cottage_cheese", "cotton_candy", "couscous", "crab", "crab_apple", "crab_boil_seasoning", "crab_claw_fish", "crab_mushroom", "crab_roe", "crab_stick", "cracker", "cranberry", "cranberry_liqueur", "cranberry_sauce", "crappie", "crayfish", "cream", "cream_cheese", "cream_liqueur", "cream_of_celery_soup", "cream_of_chicken_soup", "cream_of_mushroom_soup", "cream_of_rice", "cream_of_tartar", "cream_of_wheat", "cream_soda", "creme_anglaise", "creme_de_cacao", "creme_de_cassis", "creme_de_menthe", "creme_de_violette", "creme_fraiche", "creole_sauce", "creole_seasoning", "crepe", "crescent_roll", "crispbread", "croissant", "crosnes", "crouton", "crumb_crust", "crumpet", "cubanelle_pepper", "cucumber", "cudweed", "culantro", "cumin", "curd", "cured_chicken", "cured_duck", "cured_fish", "curing_salt", "curry", "curry_leaf", "curry_paste", "curry_powder", "custard", "custard_powder", "cynar", "dace", "daikon", "damson", "dandelion", "dango", "dark_soy_sauce", "dashi", "date", "daylily_flower", "deer_mushroom", "demi_glace", "denbu", "dextrose", "digestive_biscuit", "dijonnaise", "dill", "doenjang", "donburi_sauce", "dong_leaf", "donkey_meat", "dory", "doubanjiang", "dough", "dough_improver", "doughnut", "dragon_fruit", "dragon_whisker_vegetable", "drambuie", "dried_ganba_mushroom", "dried_lily_bud", "dried_orchid_flower", "dried_oyster", "dried_scallop", "dried_shrimp", "dried_tangerine_peel", "dried_tofu", "dried_vegetable", "dry_pot_sauce", "dubonnet", "duck", "duck_egg", "duck_fat", "duck_sauce", "duck_stock", "dukkah", "dulce_de_leche", "dumpling", "dumpling_wrapper", "durian", "earl_grey_tea", "edam_cheese", "edamame", "edible_flower", "edible_gold_leaf", "eel", "egg", "egg_noodle", "egg_roll", "egg_roll_wrapper", "egg_substitute", "egg_tofu", "egg_white", "egg_yolk", "eggnog", "eggplant", "einkorn", "elderberry", "elderflower", "elderflower_liqueur", "emmental_cheese", "empanada_shell", "enchilada_sauce", "endive", "english_muffin", "enoki_mushroom", "epazote", "epiphyllum_flower", "er_cai", "erythritol", "escarole", "espelette_pepper", "evaporated_milk", "ezine_cheese", "fajita_seasoning", "falafel", "falernum", "farina", "farmer_cheese", "farro", "fava_bean", "feijoa", "fennel", "fennel_pollen", "fennel_seed", "fenugreek_leaf", "fenugreek_seed", "fermentation_starter_cake", "fermented_black_bean", "fermented_chive_flower_paste", "fermented_fish", "fermented_glutinous_rice", "fermented_tofu", "fermented_vegetable_brine", "fern", "feta_cheese", "fiddlehead_fern", "fideo", "fig", "file_powder", "filefish", "fines_herbes", "fish", "fish_ball", "fish_cake", "fish_floss", "fish_maw", "fish_mint", "fish_noodle", "fish_oil", "fish_paste", "fish_roe", "fish_sauce", "fish_sausage", "fish_skin", "fish_stock", "fish_tofu", "five_grain_powder", "five_spice_powder", "five_willow_vegetable", "flageolet_bean", "flatbread", "flattened_young_rice", "flaxseed", "flaxseed_oil", "flounder", "flour", "flour_tortilla", "foie_gras", "fondant", "fontina_cheese", "food_coloring", "fox_nut", "frangipane", "freekeh", "french_dressing", "fresno_pepper", "fried_bread", "fried_dough_twist", "fried_gluten_ball", "fried_puffed_cracker", "fried_tofu_puff", "frisee", "frog_leg", "fromage_blanc", "frosting", "frozen_yogurt", "fructose", "fruit", "fruit_cocktail", "fruit_juice", "fruit_preserves", "fruit_puree", "fruit_tea", "fruit_vinegar", "fruitcake", "fry_sauce", "fudge", "furikake", "fuzzy_melon", "gac_fruit", "galangal", "galette", "galliano", "game_meat", "game_stock", "gammon", "ganache", "garam_masala", "gardenia_flower", "gardenia_fruit", "garland_chrysanthemum", "garlic", "garlic_chive", "garlic_scape", "gelatin", "geoduck", "geranium", "ghee", "ghost_pepper", "giardiniera", "gin", "ginger", "ginger_ale", "ginger_beer", "ginger_liqueur", "ginger_wine", "gingerbread", "gingerbread_spice", "gingersnap", "ginkgo_nut", "glass_noodle", "gloucester_cheese", "glucose_syrup", "gluten_free_flour", "glutinous_rice", "glutinous_rice_flour", "glycerin", "gnocchi", "goat", "goat_cheese", "goat_milk", "gochugaru", "gochujang", "goda_masala", "goji_berry", "golden_ear_mushroom", "golden_syrup", "goldschlager", "goose", "goose_egg", "goose_fat", "gooseberry", "gorgonzola_cheese", "gouda_cheese", "gourami", "graham_cracker", "graham_flour", "grains_of_paradise", "grana_padano", "grand_marnier", "grape", "grape_leaf", "grape_must", "grapefruit", "grapeseed_oil", "grappa", "grass_jelly", "grasshopper", "gravy", "greek_seasoning", "green_bean", "green_chili", "green_curry_paste", "green_fish", "green_olive", "green_peppercorn", "green_sichuan_peppercorn", "green_tea", "green_tomato", "gremolata", "grenadine", "grissini", "grits", "ground_ivy", "grouper", "grouse", "gruyere_cheese", "guacamole", "guajillo_chile", "guar_gum", "guascas", "guava", "guava_paste", "guinea_hen", "guizhou_sour_soup", "gulai_seasoning", "gulas", "gullac", "gum_paste", "gypsum", "habanero_pepper", "haddock", "hair_vegetable", "hairtail", "hake", "halibut", "halloumi", "halva", "ham", "hanpen", "hard_cider", "harissa", "hatch_chile", "havarti_cheese", "hawthorn", "hazelnut", "hazelnut_liqueur", "hazelnut_oil", "hearts_of_palm", "hemp_oil", "hemp_seed", "herb", "herbal_tea", "herbes_de_provence", "herbsaint", "herring", "hibiscus", "hickory_nut", "hijiki", "hog_plum", "hogao", "hoisin_sauce", "hokkien_noodle", "hollandaise_sauce", "hominy", "honey", "honey_citron_tea", "honey_mushroom", "honey_mustard", "honeycomb", "honeydew_melon", "honeysuckle_flower", "hop", "horse_gram", "horse_head_fish", "horse_mackerel", "horse_meat", "horseradish", "hot_and_sour_sauce", "hot_dog", "hot_pot_base", "hot_sauce", "hpnotiq", "huacatay", "huckleberry", "huitlacoche", "hummus", "hunan_chopped_chili", "hyacinth_bean", "iberico_ham", "ice", "ice_cream", "ice_cream_cone", "ice_jelly", "ice_plant", "idli", "indian_gooseberry", "inulin", "irish_cream", "isomalt", "isot_pepper", "italian_dressing", "italian_sausage", "italian_seasoning", "jackfruit", "jackfruit_seed", "jagermeister", "jaggery", "jalapeno", "jam", "jarlsberg_cheese", "jasmine_flower", "jasmine_tea", "jellyfish", "jerk_seasoning", "jerusalem_artichoke", "jicama", "jinhua_ham", "jobs_tears", "juniper_berry", "junket", "kabanos", "kadaifi", "kaffir_lime", "kaffir_lime_leaf", "kale", "kangaroo", "kapok_flower", "kashkaval_cheese", "kashmiri_chili", "kasseri_cheese", "kaya", "kaymak", "kefalotyri", "kefir", "kelp", "kencur", "ketchup", "khmeli_suneli", "khoya", "kidney", "kidney_bean", "kielbasa", "kimchi", "kinako", "king_oyster_mushroom", "kirschwasser", "kissel", "kiwi", "kluwek", "kohlrabi", "koji", "kokum", "komatsuna", "kombu", "kombucha", "konjac", "korean_bbq_sauce", "korean_rice_wine", "krill", "kudzu_root", "kumquat", "kvass", "la_cam_leaf", "la_giang_leaf", "labneh", "lacon", "ladyfinger", "laksa_paste", "lamb", "lambs_quarters", "langoustine", "lard", "lavender", "lecithin", "leek", "lemon", "lemon_balm", "lemon_leaf", "lemon_pepper", "lemon_verbena", "lemongrass", "lentil", "lettuce", "liangpi", "licorice_root", "light_soy_sauce", "lillet", "lily_bulb", "lima_bean", "lime", "limewater", "limoncello", "lingonberry", "linguica", "lions_mane_mushroom", "liqueur", "liquid_smoke", "liquor", "litsea_cubeba", "liver", "loach", "lobster", "loganberry", "long_pepper", "longan", "longaniza", "loquat", "loquat_leaf", "lotus_flower", "lotus_leaf", "lotus_root", "lotus_seed", "lovage", "lucuma", "luffa", "luncheon_meat", "lychee", "lye_water", "mac_khen", "mac_mat_fruit", "maca", "macadamia_nut", "mace", "mache", "mackerel", "madeira_wine", "maggi_seasoning", "mahi_mahi", "mahleb", "maitake_mushroom", "mala_sauce", "malabar_spinach", "malanga", "mallow", "malt", "malt_vinegar", "maltose", "manchego_cheese", "mandarin_fish", "mango", "mangosteen", "mantis_shrimp", "maple_syrup", "mapo_tofu_sauce", "maraschino_cherry", "maraschino_liqueur", "margarine", "marinara_sauce", "marjoram", "marlin", "marmite", "marsala_wine", "marshmallow", "marzipan", "masa_harina", "mascarpone_cheese", "masoor_dal", "mastic", "matambre", "matcha_powder", "matsoni", "matsutake_mushroom", "matzo", "mayonnaise", "mead", "meat", "meat_extract", "meat_floss", "meat_stock", "meat_tenderizer", "mei_kuei_lu_wine", "melinjo", "melon", "melon_liqueur", "melon_seed", "mentaiko", "mentsuyu", "merguez", "meringue", "mesquite", "metaxa", "mettwurst", "mezcal", "microgreen", "miiuy_croaker", "milk", "milk_bread", "milk_chocolate", "milk_tea", "milk_tofu", "milkfish", "millet", "milo", "milt", "mincemeat", "mint", "mirasol_chile", "mirepoix", "mirin", "miso", "mitsuba", "mixed_grains", "mixed_herbs", "mixed_seeds", "mixed_sprouts", "mixed_vegetable", "mizuame", "mizuna", "mocha", "mochi", "mojo", "molasses", "mole", "monk_fruit", "monkfish", "montasio_cheese", "monterey_jack_cheese", "montreal_steak_seasoning", "mopping_sauce", "morel_mushroom", "moringa", "mortadella", "moscatel_wine", "mountain_pepper", "mozzarella_cheese", "msg", "mudfish", "mudskipper", "muenster_cheese", "muffin", "mugwort", "mulato_chile", "mulberry", "mulberry_leaf", "mullet", "mulling_spice", "mung_bean", "mung_bean_jelly", "mung_bean_paste", "mung_bean_starch", "muscovado_sugar", "mushroom", "mushroom_soy_sauce", "mushroom_stock", "mussel", "mustard", "mustard_green", "mustard_oil", "mustard_root", "mustard_seed", "mutton", "myoga", "myzithra_cheese", "naan", "nameko_mushroom", "nanohana", "napa_cabbage", "narsharab", "nasturtium", "natto", "navy_bean", "nduja", "nectar", "nectarine", "needlefish", "nerikiri", "nettle", "neufchatel_cheese", "new_mexico_chile", "nigari", "nigella_seed", "noodle", "nopal", "nora_chile", "nori", "nougat", "nut", "nut_butter", "nut_oil", "nutmeg", "nutritional_yeast", "oat", "oat_milk", "oaxaca_cheese", "octopus", "offal", "oil", "okara_powder", "okonomiyaki_sauce", "okra", "olive", "olive_oil", "olluco", "onion", "oolong_tea", "orange", "orange_blossom_water", "orange_liqueur", "orange_roughy", "oregano", "orgeat", "orris_root", "osmanthus_flower", "osmanthus_wine", "ouzo", "oyster", "oyster_mushroom", "oyster_sauce", "pacific_saury", "padron_pepper", "paederia_foetida", "pagoda_tree_flower", "palm_oil", "palm_seed", "palm_sugar", "pan_drippings", "panang_curry_paste", "pancake", "pancetta", "panch_phoran", "pandan_leaf", "paneer", "panela_cheese", "panettone", "pangasius", "papad", "papaya", "papaya_leaf", "paprika", "paratha", "parmesan_cheese", "parsley", "parsley_root", "parsnip", "partridge", "pasilla_chile", "passion_fruit", "pasta", "pasta_sauce", "pastila", "pastis", "pastrami", "pastry", "pate", "pea", "pea_shoot", "peach", "peach_gum", "peanut", "peanut_butter", "peanut_oil", "peanut_sauce", "pear", "pearl_mushroom", "pecan", "pecorino_cheese", "pectin", "pennywort", "peperomia_pellucida", "pepino_melon", "peppadew_pepper", "pepper_jelly", "peppercorn_sauce", "peppermint", "pepperoncini", "pepperoni", "perch", "perilla", "perilla_oil", "periwinkle", "persimmon", "pesto", "petai_bean", "petis", "pheasant", "phyllo_dough", "picada", "pickapeppa_sauce", "pickle_juice", "pickle_relish", "pickled_cucumber", "pickled_ginger", "pickled_mustard_green", "pickled_onion", "pickled_radish", "pickled_sakura_blossom", "pickled_vegetable", "pickling_spice", "pie_crust", "pie_filling", "pigeon", "pigeon_egg", "pigeon_pea", "pike", "piloncillo", "pimento", "pina_colada_mix", "pine_nut", "pine_pollen", "pineapple", "pink_pepper", "pink_sauce", "pinto_bean", "pionono", "piquante_sauce", "piquillo_pepper", "piri_piri", "pisco", "pistachio", "pistachio_oil", "pita_bread", "pizza_crust", "pizza_sauce", "plant_based_cheese", "plant_based_cream", "plant_based_ham", "plant_based_milk", "plantain", "plum", "plum_sauce", "plum_wine", "pluot", "poblano_pepper", "pokeweed", "polenta", "pollock", "pomegranate", "pomegranate_molasses", "pomelo", "pomfret", "pompano", "ponzu", "poolish", "poppy_seed", "porcini_mushroom", "pork", "pork_stock", "port_wine", "portobello_mushroom", "potato", "poultry_seasoning", "praline", "preserved_cabbage", "preserved_lemon", "preserved_plum", "pretzel", "prickly_pear", "prosciutto", "prosecco", "provolone_cheese", "prune", "psyllium_husk", "pu_erh_tea", "pudding", "puff_pastry", "puffer_fish", "pumpkin", "pumpkin_leaf", "pumpkin_pie_spice", "pumpkin_seed", "pumpkin_seed_oil", "punch", "purple_gynura", "purple_sweet_potato", "purple_yam", "purslane", "puzi_leaf", "qingbu_liang", "qingjiang_fish", "qingtou_mushroom", "quail", "quail_egg", "quark", "queso_anejo", "queso_blanco", "queso_fresco", "quince", "quince_paste", "quinoa", "quorn", "rabbit", "raclette_cheese", "radicchio", "radish", "radish_cake", "ragi", "raisin", "raita", "rakkyo", "rambutan", "ramen_noodle", "ramp", "ranch_dressing", "rapeseed", "ras_el_hanout", "raspberry", "ravioli", "ray", "razor_clam", "red_bean", "red_bean_paste", "red_currant", "red_curry_paste", "red_date", "red_drum", "red_hots", "red_leicester_cheese", "red_onion", "red_pepper", "red_rice", "red_snapper", "red_wine", "red_wine_vinegar", "red_yeast", "reed_leaf", "refried_beans", "remoulade_sauce", "rhubarb", "rice", "rice_bran_oil", "rice_cake", "rice_milk", "rice_noodle", "rice_paddy_herb", "rice_paper", "rice_tofu", "rice_vinegar", "rice_wine", "ricotta_cheese", "ricotta_salata", "robiola_cheese", "rock_sugar", "rock_tripe", "rockfish", "rocoto_pepper", "romanesco", "romano_cheese", "romesco_sauce", "rompope", "rooibos_tea", "root_beer", "roquefort_cheese", "rose_syrup", "rose_wine", "rosehip", "rosemary", "rosewater", "roti", "rouille", "roux", "rowan_berry", "royal_icing", "rum", "rusk", "rutabaga", "ryazhenka", "rye", "rye_bread", "sachima", "safflower", "safflower_oil", "saffron", "sage", "sago", "sake", "salad_cream", "salad_dressing", "salad_greens", "salam_leaf", "salami", "salep", "salmon", "salmon_roe", "salsa", "salsa_verde", "salsify", "salt", "salt_cod", "salt_pork", "salted_duck_egg", "sambal", "sambal_oelek", "sambar_powder", "sambuca", "sand_ginger", "sand_worm", "sangria", "sansho_pepper", "sanzi", "sardine", "saskatoon_berry", "sau_fruit", "sauerkraut", "sausage", "sauternes", "savory", "sazon", "scad", "scallion", "scallion_oil", "scallop", "scamorza", "schisandra_berry", "schnapps", "scotch_bonnet_pepper", "sea_bass", "sea_bream", "sea_buckthorn", "sea_coconut", "sea_cucumber", "sea_grape", "sea_hare", "sea_lettuce", "sea_moss", "sea_snail", "sea_urchin", "seafood", "seafood_sauce", "seafood_seasoning", "seafood_stock", "seasoning_sauce", "seaweed", "semolina", "senbei", "serrano_ham", "serrano_pepper", "sesame_oil", "sesame_paste", "sesame_seed", "sev", "shacha_sauce", "shallot", "shaobing", "shaoxing_wine", "shark", "shark_fin", "shellfish", "shepherds_purse", "sherbet", "sherry", "sherry_vinegar", "shichimi_togarashi", "shiitake_mushroom", "shio_koji", "shirasu", "shirataki_noodle", "shochu", "shortcake", "shortening", "shrimp", "shrimp_mushroom", "shrimp_paste", "sichuan_peppercorn", "silkworm_pupa", "simit", "skate", "smelt", "smoked_cheese", "smoked_meat", "smoked_paprika", "smoked_salmon", "smoked_salt", "snail", "snail_rice_noodle", "snake", "snake_gourd", "snakehead_fish", "snow_fungus", "snow_pea", "snow_vegetable", "sobrasada", "sofrito", "soju", "sole", "somen_noodle", "soppressata", "sorghum", "sorghum_syrup", "sorrel", "sour_bamboo_shoot", "sour_broth", "sour_cream", "sour_mix", "soursop", "southern_comfort", "soy_milk", "soy_protein_isolate", "soy_sauce", "soy_yogurt", "soybean", "soybean_oil", "soybean_paste", "soybean_sprout", "spaetzle", "sparkling_water", "sparkling_wine", "speck", "speculoos_cookie", "spelt", "spice_mix", "spinach", "spirulina", "sponge_cake", "sprat", "spring_roll", "spring_roll_wrapper", "sprinkles", "squash", "squash_blossom", "squid", "squid_ink", "squirrel", "sriracha", "ssamjang", "star_anise", "starch", "starfruit", "steak_sauce", "steamed_bun", "stevia", "stilton_cheese", "stinky_mandarin_fish", "stinky_tofu", "stir_fry_sauce", "stout", "stracchino_cheese", "straw_mushroom", "strawberry", "strega_liqueur", "sturgeon", "sucuk", "suet", "sugar", "sugar_snap_pea", "sugarcane", "sukiyaki_sauce", "sulguni_cheese", "sumac", "summer_sausage", "sun_dried_tomato", "sunfish", "sunflower_oil", "sunflower_seed", "superior_stock", "sushi_vinegar", "sushki", "sweet_and_sour_sauce", "sweet_bean_sauce", "sweet_chili_sauce", "sweet_potato", "sweet_potato_leaf", "sweet_potato_starch", "sweet_preserved_mustard_green", "sweet_roll", "sweet_soy_sauce", "sweet_vermouth", "sweetbread", "swiss_chard", "swiss_cheese", "swiss_roll", "sword_bean", "swordfish", "syrup", "ta_cai", "tabasco_pepper", "taco_sauce", "taco_seasoning", "taco_shell", "tahini", "tajin", "taleggio_cheese", "tallow", "tamale", "tamari", "tamarillo", "tamarind", "tandoori_masala", "tangelo", "tangerine", "tapenade", "tapioca", "tapioca_pearl", "tarako", "tarhana", "taro", "taro_stem", "tarragon", "tartar_sauce", "tasso", "tatsoi", "tauco", "tea", "tea_tree_mushroom", "teff", "tempeh", "tempura_flour", "tenkasu", "tequila", "teriyaki_sauce", "termite_mushroom", "textured_soy_protein", "thai_basil", "thai_tea", "thousand_island_dressing", "thyme", "tiger_milk_mushroom", "tikka_masala", "tilapia", "tkemali_sauce", "toffee", "tofu", "tofu_pudding", "tofu_skin", "tom_yum_paste", "tomatillo", "tomato", "tonguefish", "tonic_water", "tonka_bean", "tonkatsu_sauce", "toor_dal", "topmouth_culter", "tortellini", "tortilla", "trehalose", "triple_sec", "trout", "truffle_oil", "tsao_ko", "tteokbokki_sauce", "tulum_cheese", "tuna", "turbot", "turkey", "turkey_sausage", "turkey_stock", "turkish_delight", "turmeric", "turmeric_leaf", "turnip", "turnip_green", "turtle", "tzatziki", "udon_noodle", "umami_sauce", "ume", "umeboshi", "umeboshi_vinegar", "unagi_kabayaki", "unagi_sauce", "urad_dal", "utskho_suneli", "vadouvan", "vanilla", "veal", "vegemite", "vegeta_seasoning", "vegetable_extract", "vegetable_juice", "vegetable_oil", "vegetable_puree", "vegetable_stock", "vegetarian_oyster_sauce", "velveeta_cheese", "venison", "verjuice", "vermicelli", "vermouth", "viburnum", "vienna_sausage", "vietnamese_balm", "vietnamese_coriander", "vietnamese_pork_roll", "vin_santo", "vinaigrette", "vinegar", "violet", "vodka", "wafer", "waffle", "wakame", "walleye", "walnut", "walnut_oil", "wampee", "wasabi", "water", "water_bamboo", "water_celery", "water_chestnut", "water_lily_flower", "water_mimosa", "water_shield", "water_spinach", "watercress", "watermelon", "watermelon_radish", "wax_apple", "weipa", "wheat", "wheat_germ", "wheat_gluten", "whelk", "whey", "whipped_topping", "whiskey", "white_bean", "white_chocolate", "white_pepper", "white_soy_sauce", "white_tea", "white_truffle", "white_vinegar", "white_wine", "white_wine_vinegar", "whitebait", "whitefish", "whiting", "whole_wheat_flour", "wild_betel_leaf", "wild_boar", "wild_garlic", "wild_ginger", "wild_rice", "wine", "wine_lees", "winged_bean", "winter_melon", "wintergreen", "wisteria_flower", "wolfberry_leaf", "wolffish", "wonton", "wood_ear_mushroom", "worcestershire_sauce", "wuchang_fish", "xanthan_gum", "xo_sauce", "xylitol", "yacon", "yak_meat", "yakiniku_sauce", "yakisoba_sauce", "yam", "yard_long_bean", "yeast", "yellow_croaker", "yellow_curry_paste", "yibin_yacai", "yogurt", "youtiao", "yu_choy", "yufka", "yuzu", "yuzu_kosho", "zaatar", "zao_lu", "zha_cai", "zhajiang_sauce", "zucchini", "zucchini_flower"], "food_groups": ["Other", "Vegetable", "Beverage", "Other", "Fruit", "Fruit", "Spice", "Other", "Vegetable", "Pantry", "Spice", "Pantry", "Spice", "Beverage", "Pantry", "Vegetable", "Other", "Beverage", "Vegetable", "Spice", "Pantry", "Spice", "Pantry", "Spice", "Vegetable", "Pantry", "Other", "Spice", "Other", "Other", "Other", "Beverage", "Other", "Other", "Vegetable", "Pantry", "Grain", "Other", "Beverage", "Beverage", "Beverage", "Other", "Spice", "Dairy", "Vegetable", "Spice", "Spice", "Other", "Other", "Other", "Spice", "Beverage", "Spice", "Other", "Fruit", "Beverage", "Beverage", "Pantry", "Spice", "Pantry", "Fruit", "Beverage", "Other", "Beverage", "Other", "Other", "Grain", "Other", "Beverage", "Fruit", "Vegetable", "Vegetable", "Vegetable", "Vegetable", "Spice", "Spice", "Pantry", "Dairy", "Fruit", "Vegetable", "Other", "Fruit", "Other", "Dairy", "Other", "Grain", "Spice", "Grain", "Beverage", "Spice", "Other", "Pantry", "Pantry", "Pantry", "Spice", "Pantry", "Other", "Other", "Other", "Vegetable", "Pantry", "Vegetable", "Fruit", "Vegetable", "Other", "Vegetable", "Pantry", "Spice", "Fruit", "Grain", "Vegetable", "Other", "Other", "Other", "Other", "Grain", "Other", "Other", "Other", "Vegetable", "Other", "Pantry", "Pantry", "Pantry", "Other", "Beverage", "Vegetable", "Dairy", "Vegetable", "Vegetable", "Beverage", "Spice", "Fruit", "Fruit", "Fruit", "Spice", "Pantry", "Spice", "Grain", "Grain", "Other", "Other", "Vegetable", "Vegetable", "Fruit", "Pantry", "Beverage", "Other", "Pantry", "Fruit", "Other", "Vegetable", "Vegetable", "Spice", "Grain", "Pantry", "Other", "Beverage", "Other", "Vegetable", "Pantry", "Fruit", "Spice", "Fruit", "Other", "Other", "Beverage", "Dairy", "Beverage", "Fruit", "Other", "Vegetable", "Grain", "Pantry", "Other", "Other", "Other", "Other", "Other", "Other", "Other", "Other", "Vegetable", "Other", "Beverage", "Dairy", "Fruit", "Pantry", "Grain", "Beverage", "Other", "Other", "Other", "Other", "Grain", "Grain", "Fruit", "Other", "Other", "Pantry", "Dairy", "Beverage", "Dairy", "Pantry", "Grain", "Vegetable", "Vegetable", "Vegetable", "Pantry", "Grain", "Pantry", "Other", "Pantry", "Vegetable", "Dairy", "Grain", "Pantry", "Other", "Dairy", "Pantry", "Pantry", "Pantry", "Grain", "Vegetable", "Dairy", "Other", "Dairy", "Other", "Other", "Other", "Dairy", "Vegetable", "Other", "Vegetable", "Pantry", "Beverage", "Dairy", "Pantry", "Dairy", "Spice", "Spice", "Fruit", "Pantry", "Other", "Beverage", "Beverage", "Other", "Dairy", "Beverage", "Other", "Fruit", "Other", "Other", "Other", "Other", "Pantry", "Other", "Grain", "Other", "Dairy", "Fruit", "Fruit", "Other", "Other", "Other", "Other", "Other", "Other", "Spice", "Spice", "Vegetable", "Pantry", "Other", "Other", "Pantry", "Vegetable", "Other", "Other", "Spice", "Other", "Vegetable", "Other", "Other", "Vegetable", "Other", "Vegetable", "Beverage", "Other", "Spice", "Vegetable", "Vegetable", "Spice", "Vegetable", "Dairy", "Grain", "Spice", "Spice", "Other", "Beverage", "Pantry", "Other", "Vegetable", "Vegetable", "Other", "Pantry", "Beverage", "Vegetable", "Dairy", "Dairy", "Vegetable", "Fruit", "Other", "Other", "Beverage", "Vegetable", "Fruit", "Other", "Dairy", "Other", "Other", "Beverage", "Other", "Pantry", "Other", "Other", "Vegetable", "Dairy", "Other", "Spice", "Pantry", "Other", "Pantry", "Vegetable", "Spice", "Pantry", "Spice", "Fruit", "Vegetable", "Vegetable", "Other", "Pantry", "Other", "Vegetable", "Vegetable", "Spice", "Other", "Other", "Other", "Other", "Other", "Beverage", "Fruit", "Spice", "Other", "Grain", "Vegetable", "Other", "Pantry", "Pantry", "Vegetable", "Pantry", "Grain", "Other", "Spice", "Vegetable", "Pantry", "Fruit", "Fruit", "Other", "Beverage", "Pantry", "Pantry", "Fruit", "Dairy", "Spice", "Other", "Beverage", "Other", "Other", "Pantry", "Other", "Pantry", "Pantry", "Fruit", "Pantry", "Fruit", "Beverage", "Fruit", "Other", "Other", "Pantry", "Beverage", "Other", "Other", "Beverage", "Dairy", "Beverage", "Beverage", "Grain", "Beverage", "Dairy", "Grain", "Vegetable", "Dairy", "Other", "Dairy", "Pantry", "Other", "Other", "Other", "Other", "Other", "Other", "Other", "Vegetable", "Grain", "Vegetable", "Other", "Pantry", "Other", "Other", "Grain", "Grain", "Other", "Fruit", "Grain", "Grain", "Other", "Dairy", "Dairy", "Other", "Grain", "Other", "Fruit", "Spice", "Other", "Vegetable", "Other", "Other", "Grain", "Fruit", "Beverage", "Pantry", "Other", "Other", "Dairy", "Dairy", "Beverage", "Pantry", "Pantry", "Pantry", "Grain", "Pantry", "Grain", "Beverage", "Dairy", "Beverage", "Beverage", "Beverage", "Beverage", "Dairy", "Pantry", "Spice", "Grain", "Grain", "Grain", "Grain", "Vegetable", "Grain", "Grain", "Grain", "Vegetable", "Vegetable", "Other", "Other", "Spice", "Dairy", "Other", "Other", "Other", "Pantry", "Spice", "Other", "Pantry", "Spice", "Other", "Pantry", "Beverage", "Other", "Vegetable", "Fruit", "Vegetable", "Other", "Pantry", "Pantry", "Fruit", "Vegetable", "Vegetable", "Pantry", "Other", "Other", "Other", "Pantry", "Other", "Pantry", "Pantry", "Other", "Other", "Other", "Pantry", "Grain", "Pantry", "Grain", "Fruit", "Vegetable", "Beverage", "Vegetable", "Vegetable", "Other", "Other", "Other", "Other", "Spice", "Other", "Vegetable", "Pantry", "Beverage", "Other", "Dairy", "Other", "Pantry", "Other", "Spice", "Dairy", "Grain", "Grain", "Fruit", "Beverage", "Dairy", "Other", "Vegetable", "Pantry", "Other", "Dairy", "Grain", "Grain", "Grain", "Dairy", "Other", "Dairy", "Dairy", "Dairy", "Vegetable", "Grain", "Fruit", "Other", "Beverage", "Dairy", "Grain", "Pantry", "Vegetable", "Grain", "Vegetable", "Other", "Vegetable", "Vegetable", "Other", "Vegetable", "Spice", "Dairy", "Dairy", "Spice", "Other", "Beverage", "Grain", "Dairy", "Grain", "Other", "Fruit", "Vegetable", "Spice", "Spice", "Other", "Spice", "Pantry", "Other", "Pantry", "Other", "Grain", "Other", "Pantry", "Vegetable", "Dairy", "Vegetable", "Grain", "Fruit", "Spice", "Other", "Other", "Other", "Other", "Other", "Other", "Other", "Other", "Other", "Other", "Other", "Other", "Pantry", "Other", "Other", "Pantry", "Other", "Grain", "Spice", "Vegetable", "Other", "Grain", "Grain", "Other", "Other", "Other", "Grain", "Grain", "Other", "Other", "Dairy", "Pantry", "Other", "Other", "Grain", "Pantry", "Vegetable", "Grain", "Grain", "Other", "Grain", "Other", "Vegetable", "Other", "Dairy", "Other", "Dairy", "Other", "Fruit", "Fruit", "Beverage", "Other", "Fruit", "Beverage", "Pantry", "Other", "Pantry", "Other", "Spice", "Vegetable", "Fruit", "Spice", "Grain", "Beverage", "Other", "Pantry", "Other", "Other", "Spice", "Other", "Pantry", "Vegetable", "Vegetable", "Vegetable", "Vegetable", "Pantry", "Other", "Other", "Other", "Spice", "Vegetable", "Beverage", "Spice", "Beverage", "Beverage", "Beverage", "Beverage", "Pantry", "Spice", "Pantry", "Other", "Grain", "Dairy", "Other", "Grain", "Grain", "Grain", "Pantry", "Grain", "Other", "Dairy", "Dairy", "Spice", "Pantry", "Spice", "Fruit", "Vegetable", "Other", "Beverage", "Other", "Dairy", "Other", "Fruit", "Dairy", "Dairy", "Other", "Pantry", "Grain", "Spice", "Dairy", "Beverage", "Fruit", "Vegetable", "Fruit", "Fruit", "Other", "Beverage", "Other", "Other", "Pantry", "Spice", "Vegetable", "Vegetable", "Pantry", "Other", "Fruit", "Spice", "Spice", "Beverage", "Vegetable", "Other", "Other", "Grain", "Grain", "Other", "Other", "Other", "Dairy", "Pantry", "Spice", "Pantry", "Other", "Fruit", "Other", "Other", "Pantry", "Spice", "Pantry", "Other", "Other", "Pantry", "Vegetable", "Other", "Vegetable", "Other", "Other", "Other", "Dairy", "Other", "Other", "Other", "Beverage", "Spice", "Vegetable", "Dairy", "Fruit", "Other", "Beverage", "Other", "Vegetable", "Other", "Other", "Other", "Beverage", "Other", "Beverage", "Other", "Beverage", "Other", "Other", "Fruit", "Pantry", "Pantry", "Grain", "Pantry", "Grain", "Other", "Beverage", "Vegetable", "Pantry", "Other", "Fruit", "Other", "Other", "Other", "Other", "Other", "Other", "Spice", "Pantry", "Other", "Pantry", "Pantry", "Beverage", "Other", "Fruit", "Vegetable", "Other", "Spice", "Other", "Other", "Beverage", "Dairy", "Grain", "Other", "Vegetable", "Grain", "Fruit", "Pantry", "Beverage", "Other", "Spice", "Pantry", "Other", "Spice", "Fruit", "Other", "Beverage", "Other", "Vegetable", "Other", "Dairy", "Other", "Beverage", "Other", "Spice", "Vegetable", "Vegetable", "Other", "Grain", "Spice", "Dairy", "Other", "Grain", "Fruit", "Other", "Vegetable", "Other", "Vegetable", "Dairy", "Spice", "Dairy", "Other", "Dairy", "Dairy", "Dairy", "Other", "Spice", "Pantry", "Spice", "Dairy", "Other", "Other", "Other", "Vegetable", "Other", "Vegetable", "Beverage", "Other", "Fruit", "Other", "Vegetable", "Pantry", "Fruit", "Vegetable", "Other", "Beverage", "Vegetable", "Pantry", "Beverage", "Other", "Vegetable", "Fruit", "Beverage", "Other", "Other", "Dairy", "Other", "Other", "Pantry", "Other", "Vegetable", "Other", "Other", "Other", "Other", "Vegetable", "Fruit", "Other", "Other", "Spice", "Other", "Other", "Other", "Vegetable", "Grain", "Other", "Pantry", "Beverage", "Vegetable", "Other", "Fruit", "Pantry", "Beverage", "Fruit", "Other", "Vegetable", "Beverage", "Pantry", "Beverage", "Spice", "Other", "Other", "Other", "Fruit", "Spice", "Fruit", "Other", "Fruit", "Other", "Other", "Other", "Vegetable", "Other", "Other", "Fruit", "Vegetable", "Other", "Fruit", "Pantry", "Spice", "Fruit", "Vegetable", "Other", "Spice", "Vegetable", "Other", "Beverage", "Pantry", "Other", "Spice", "Vegetable", "Pantry", "Vegetable", "Vegetable", "Other", "Grain", "Pantry", "Other", "Dairy", "Other", "Fruit", "Fruit", "Other", "Other", "Pantry", "Fruit", "Beverage", "Other", "Pantry", "Other", "Other", "Pantry", "Beverage", "Other", "Other", "Grain", "Dairy", "Other", "Spice", "Other", "Beverage", "Dairy", "Vegetable", "Grain", "Other", "Beverage", "Other", "Pantry", "Other", "Pantry", "Pantry", "Beverage", "Other", "Fruit", "Beverage", "Other", "Other", "Pantry", "Other", "Other", "Spice", "Beverage", "Other", "Beverage", "Vegetable", "Other", "Dairy", "Grain", "Other", "Beverage", "Dairy", "Other", "Grain", "Grain", "Other", "Other", "Other", "Spice", "Vegetable", "Pantry", "Other", "Other", "Grain", "Other", "Other", "Vegetable", "Vegetable", "Other", "Vegetable", "Beverage", "Grain", "Pantry", "Other", "Pantry", "Fruit", "Other", "Dairy", "Dairy", "Spice", "Pantry", "Vegetable", "Vegetable", "Other", "Beverage", "Spice", "Dairy", "Pantry", "Other", "Other", "Dairy", "Grain", "Other", "Spice", "Fruit", "Other", "Other", "Spice", "Other", "Other", "Other", "Pantry", "Other", "Vegetable", "Pantry", "Pantry", "Other", "Pantry", "Vegetable", "Other", "Vegetable", "Spice", "Other", "Vegetable", "Dairy", "Grain", "Vegetable", "Vegetable", "Vegetable", "Pantry", "Other", "Other", "Other", "Other", "Beverage", "Fruit", "Other", "Other", "Other", "Dairy", "Vegetable", "Pantry", "Spice", "Grain", "Vegetable", "Spice", "Other", "Other", "Other", "Other", "Other", "Spice", "Pantry", "Grain", "Beverage", "Dairy", "Other", "Other", "Other", "Other", "Pantry", "Vegetable", "Vegetable", "Other", "Vegetable", "Vegetable", "Beverage", "Fruit", "Pantry", "Beverage", "Other", "Other", "Other", "Other", "Other", "Beverage", "Beverage", "Other", "Vegetable", "Pantry", "Other", "Vegetable", "Other", "Other", "Other", "Other", "Other", "Other", "Pantry", "Grain", "Other", "Spice", "Other", "Dairy", "Dairy", "Other", "Other", "Pantry", "Fruit", "Other", "Spice", "Grain", "Dairy", "Other", "Vegetable", "Vegetable", "Other", "Spice", "Fruit", "Grain", "Pantry", "Other", "Beverage", "Other", "Other", "Other", "Vegetable", "Vegetable", "Fruit", "Pantry", "Other", "Other", "Other", "Pantry", "Fruit", "Vegetable", "Other", "Dairy", "Pantry", "Other", "Other", "Fruit", "Vegetable", "Pantry", "Pantry", "Other", "Vegetable", "Other", "Other", "Other", "Other", "Other", "Fruit", "Pantry", "Other", "Pantry", "Other", "Grain", "Pantry", "Pantry", "Pantry", "Pantry", "Vegetable", "Spice", "Vegetable", "Vegetable", "Vegetable", "Pantry", "Vegetable", "Spice", "Grain", "Other", "Other", "Dairy", "Other", "Other", "Other", "Vegetable", "Beverage", "Other", "Pantry", "Fruit", "Spice", "Pantry", "Other", "Grain", "Pantry", "Vegetable", "Spice", "Beverage", "Other", "Other", "Grain", "Grain", "Pantry", "Dairy", "Pantry", "Pantry", "Beverage", "Fruit", "Fruit", "Pantry", "Beverage", "Fruit", "Vegetable", "Vegetable", "Grain", "Other", "Fruit", "Pantry", "Fruit", "Other", "Other", "Pantry", "Grain", "Spice", "Vegetable", "Other", "Pantry", "Beverage", "Vegetable", "Vegetable", "Spice", "Other", "Vegetable", "Pantry", "Fruit", "Grain", "Fruit", "Other", "Beverage", "Dairy", "Fruit", "Pantry", "Beverage", "Other", "Grain", "Other", "Vegetable", "Vegetable", "Spice", "Other", "Other", "Beverage", "Vegetable", "Vegetable", "Vegetable", "Vegetable", "Other", "Pantry", "Other", "Vegetable", "Other", "Dairy", "Dairy", "Dairy", "Dairy", "Dairy", "Fruit", "Fruit", "Grain", "Pantry", "Other", "Dairy", "Vegetable", "Vegetable", "Vegetable", "Grain", "Fruit", "Dairy", "Vegetable", "Fruit", "Grain", "Vegetable", "Other", "Other", "Spice", "Fruit", "Grain", "Other", "Other", "Other", "Other", "Fruit", "Spice", "Fruit", "Other", "Other", "Dairy", "Vegetable", "Vegetable", "Grain", "Other", "Beverage", "Pantry", "Pantry", "Other", "Other", "Pantry", "Vegetable", "Grain", "Other", "Grain", "Beverage", "Grain", "Other", "Grain", "Grain", "Pantry", "Beverage", "Dairy", "Dairy", "Dairy", "Other", "Vegetable", "Other", "Spice", "Vegetable", "Dairy", "Pantry", "Beverage", "Beverage", "Beverage", "Dairy", "Other", "Beverage", "Fruit", "Other", "Pantry", "Grain", "Pantry", "Pantry", "Fruit", "Other", "Beverage", "Grain", "Vegetable", "Dairy", "Grain", "Grain", "Other", "Other", "Other", "Spice", "Other", "Grain", "Beverage", "Pantry", "Pantry", "Vegetable", "Other", "Other", "Pantry", "Other", "Other", "Pantry", "Pantry", "Vegetable", "Pantry", "Other", "Other", "Dairy", "Pantry", "Pantry", "Spice", "Beverage", "Spice", "Other", "Beverage", "Spice", "Grain", "Other", "Fruit", "Fruit", "Vegetable", "Other", "Beverage", "Other", "Spice", "Other", "Vegetable", "Other", "Other", "Dairy", "Fruit", "Beverage", "Vegetable", "Other", "Other", "Fruit", "Fruit", "Other", "Other", "Other", "Other", "Other", "Other", "Other", "Other", "Pantry", "Spice", "Pantry", "Pantry", "Other", "Grain", "Grain", "Other", "Vegetable", "Other", "Other", "Other", "Pantry", "Pantry", "Vegetable", "Grain", "Beverage", "Other", "Other", "Other", "Vegetable", "Other", "Beverage", "Pantry", "Spice", "Vegetable", "Pantry", "Other", "Pantry", "Beverage", "Grain", "Other", "Other", "Vegetable", "Other", "Spice", "Other", "Grain", "Other", "Other", "Dairy", "Other", "Spice", "Other", "Pantry", "Other", "Pantry", "Other", "Vegetable", "Other", "Vegetable", "Vegetable", "Vegetable", "Other", "Pantry", "Beverage", "Other", "Grain", "Other", "Grain", "Other", "Other", "Vegetable", "Pantry", "Dairy", "Beverage", "Fruit", "Beverage", "Beverage", "Other", "Pantry", "Other", "Other", "Other", "Other", "Other", "Grain", "Beverage", "Beverage", "Other", "Other", "Grain", "Spice", "Vegetable", "Vegetable", "Grain", "Other", "Pantry", "Grain", "Other", "Vegetable", "Vegetable", "Other", "Other", "Other", "Pantry", "Pantry", "Spice", "Pantry", "Fruit", "Pantry", "Grain", "Other", "Dairy", "Other", "Other", "Pantry", "Beverage", "Dairy", "Vegetable", "Fruit", "Beverage", "Other", "Other", "Other", "Other", "Vegetable", "Other", "Pantry", "Dairy", "Spice", "Other", "Vegetable", "Other", "Other", "Other", "Pantry", "Pantry", "Grain", "Pantry", "Pantry", "Pantry", "Vegetable", "Vegetable", "Grain", "Vegetable", "Other", "Pantry", "Beverage", "Other", "Vegetable", "Dairy", "Other", "Other", "Other", "Other", "Vegetable", "Spice", "Pantry", "Spice", "Grain", "Other", "Spice", "Dairy", "Other", "Grain", "Pantry", "Fruit", "Fruit", "Spice", "Fruit", "Fruit", "Pantry", "Grain", "Pantry", "Other", "Grain", "Vegetable", "Vegetable", "Other", "Pantry", "Other", "Vegetable", "Pantry", "Beverage", "Vegetable", "Grain", "Other", "Grain", "Pantry", "Beverage", "Pantry", "Vegetable", "Other", "Other", "Beverage", "Pantry", "Other", "Vegetable", "Spice", "Other", "Pantry", "Other", "Other", "Other", "Other", "Pantry", "Vegetable", "Vegetable", "Other", "Beverage", "Spice", "Pantry", "Other", "Other", "Grain", "Grain", "Other", "Beverage", "Other", "Other", "Spice", "Pantry", "Dairy", "Other", "Other", "Other", "Other", "Other", "Other", "Spice", "Other", "Vegetable", "Vegetable", "Other", "Dairy", "Grain", "Pantry", "Fruit", "Fruit", "Pantry", "Other", "Pantry", "Other", "Spice", "Spice", "Spice", "Other", "Pantry", "Spice", "Pantry", "Beverage", "Other", "Vegetable", "Pantry", "Pantry", "Dairy", "Other", "Pantry", "Grain", "Beverage", "Fruit", "Other", "Other", "Other", "Other", "Beverage", "Other", "Pantry", "Other", "Beverage", "Grain", "Grain", "Other", "Other", "Other", "Other", "Fruit", "Spice", "Beverage", "Vegetable", "Vegetable", "Vegetable", "Other", "Vegetable", "Vegetable", "Vegetable", "Vegetable", "Fruit", "Vegetable", "Fruit", "Pantry", "Grain", "Grain", "Pantry", "Other", "Dairy", "Dairy", "Beverage", "Other", "Other", "Spice", "Pantry", "Beverage", "Vegetable", "Pantry", "Beverage", "Pantry", "Other", "Other", "Other", "Grain", "Other", "Other", "Other", "Spice", "Grain", "Beverage", "Beverage", "Other", "Vegetable", "Other", "Other", "Vegetable", "Other", "Grain", "Vegetable", "Pantry", "Other", "Pantry", "Pantry", "Other", "Vegetable", "Other", "Pantry", "Pantry", "Vegetable", "Vegetable", "Pantry", "Other", "Pantry", "Vegetable", "Dairy", "Grain", "Vegetable", "Grain", "Fruit", "Pantry", "Spice", "Beverage", "Vegetable", "Pantry", "Vegetable", "Vegetable"]}
|
requirements.txt
CHANGED
|
@@ -2,4 +2,6 @@ gradio>=5.0.0
|
|
| 2 |
huggingface_hub>=0.24.0
|
| 3 |
safetensors>=0.4.0
|
| 4 |
numpy>=1.24
|
|
|
|
|
|
|
| 5 |
audioop-lts; python_version >= "3.13"
|
|
|
|
| 2 |
huggingface_hub>=0.24.0
|
| 3 |
safetensors>=0.4.0
|
| 4 |
numpy>=1.24
|
| 5 |
+
plotly>=5.20.0
|
| 6 |
+
rapidfuzz>=3.6.0
|
| 7 |
audioop-lts; python_version >= "3.13"
|
umap_2d.npz
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:56b8e0ef5a2e8b38f42ea9a87fef56d98ee1cf9408ac138e89b2345458434ed6
|
| 3 |
+
size 43702
|