Concepts

Dietary Detection

dish-embed identifies proteins and dietary signals in menu item names. This powers safety checks across multiple endpoints.

What it detects

The system recognizes common proteins from its taxonomy:

Non-vegetarian: chicken, mutton, lamb, prawns, shrimp, fish, pork, beef, egg, crab, lobster, duck, turkey, bacon, ham, salmon, tuna

Vegetarian: paneer, mushroom, tofu, soya, jackfruit

Detection is keyword-based, not ML-based. If the protein name appears in the item text, it's detected with 100% reliability.

Where it's used

/match endpoint

Returns dietary_conflict and protein_conflict flags when comparing two items:

{
  "item_a": "Chicken Tikka",
  "item_b": "Paneer Tikka",
  "is_match": false,
  "dietary_conflict": true,
  "protein_conflict": ["chicken", "paneer"]
}

Even if the names are textually similar, a dietary conflict prevents a false match.

/dedup endpoint

Items with conflicting proteins are never clustered together, regardless of similarity score. "Chicken Burger" and "Veg Burger" will always remain separate items.

/suggest endpoint

When all items in the cart are vegetarian, only vegetarian suggestions are returned. The engine never recommends "Chicken Wings" to someone whose cart contains only "Paneer Tikka" and "Dal Makhani".

/report endpoint

The menu health report includes dietary analysis, flagging potential data issues like a "Veg" tagged item containing "chicken" in the name.

Limitations

  • Exotic proteins: Uncommon proteins not in the taxonomy (e.g., "bison", "venison", "quail") may not be detected.
  • Ambiguous names: "Drumstick Soup" is ambiguous (chicken drumstick or drumstick vegetable). The system flags "drumstick" only if other context confirms meat.
  • Abbreviations: Very short or heavily abbreviated names ("CKN TKA") may not trigger detection.
  • Implicit proteins: "Pepperoni Pizza" contains pork, but "pepperoni" is a processed product name that may not trigger the raw protein detector. Common processed items like pepperoni, salami, and bacon are explicitly handled.

Not a full allergen system

Dietary detection in dish-embed is designed for menu data quality and dedup safety. It identifies primary protein ingredients visible in item names. It is not a substitute for a full allergen management system that tracks hidden ingredients, cross-contamination, or regulatory compliance.