# Restaurant Menu Ingredient & EU Allergen Dataset This dataset was created to support the development of **machine learning models and restaurant software systems for detecting the 14 EU food allergens from recipe ingredients**. ## Data Source The dataset is primarily derived from **RecipeNLG**, a large-scale collection containing approximately **2.3 million recipes**. A restaurant-oriented subset was selected from this collection. The selection was designed to represent a wide variety of menu items, including main dishes, soups, salads, appetizers, mezze, desserts, bakery products, breads, pasta and noodles, meat and poultry dishes, fish and seafood, vegetarian and vegan dishes, breakfast foods, sauces, snacks, and beverages. Duplicate or highly similar recipes were reduced where appropriate. Menu item names that were unsuitable for general restaurant use were also reviewed, cleaned, renamed, or removed. ## Data Preparation The original RecipeNLG ingredient descriptions often contain quantities, measurement units, package sizes, and preparation instructions. A Gemini-based ingredient extraction pipeline was used to convert these raw ingredient descriptions into cleaner ingredient identities. For example: `2 cups shredded cheddar cheese` becomes: `cheddar cheese` The extraction process was designed to preserve the actual ingredient identity while separating: - Main ingredients - Optional ingredients - Alternative ingredient groups After ingredient cleaning, an initial allergen detection stage was performed using a deterministic **NLP / regex-based rule system**. The rule system considered both direct allergen ingredients and established compound foods such as: - Soy sauce - Mayonnaise - Hummus - Tahini - Pesto - Worcestershire sauce - Oyster sauce - Fish sauce False-positive cases were also handled, such as coconut milk, oyster mushrooms, eggplant, nutmeg, and other potentially misleading ingredient names. ## Final Allergen Audit The allergen labels were subsequently reviewed using the **Gemini 3.5 Flash API**. The model was instructed to use culinary knowledge rather than simple keyword matching and to consider: - Hidden allergens in compound ingredients - Traditional food compositions - Explicit allergen-free variants - False-positive cases - Ambiguous ingredients - EU allergen definitions When an allergen set was considered incorrect, the complete corrected allergen set was returned and applied to the dataset. Because lupin was underrepresented in the original data, additional **real and source-based lupin / chocho / tremoços recipes** were added to ensure coverage of all 14 EU allergen classes. ## EU 14 Allergen Labels The dataset uses the following standardized labels: ```text gluten crustaceans eggs fish peanuts soy milk tree_nuts celery mustard sesame sulphites lupin molluscs Dataset Columns Column Description recipe_id Unique identifier for each recipe title Dish or menu item name ingredients Original raw ingredient list from the source source Original recipe source link Source URL when available ingredients_clean Cleaned main ingredient names without quantities or preparation instructions optional_ingredients Ingredients explicitly marked as optional alternative_groups Groups of ingredients that may substitute for one another allergens_primary EU 14 allergens detected from the main ingredient configuration allergens_all_possible Broader allergen set that may include optional or alternative ingredients The primary target used for allergen modeling in this project is allergens_primary. Preparation Pipeline RecipeNLG (~2.3M recipes) ↓ Restaurant-oriented recipe selection ↓ Duplicate reduction and menu-name cleaning ↓ Gemini-based ingredient extraction ↓ NLP / regex allergen detection ↓ Gemini 3.5 Flash final allergen audit ↓ Additional real lupin recipe coverage ↓ Final dataset Dataset Statistics Final dataset size: 55,658 recipes EU allergen classes: 14 Unique recipe IDs: 55,658 Primary allergen target: allergens_primary All 14 EU allergen classes are represented Lupin-containing recipes: 38 More detailed allergen frequency statistics can be calculated directly from the released CSV. Intended Uses This dataset may be useful for: Food allergen classification Restaurant menu analysis Ingredient understanding Machine learning research Restaurant management software Menu intelligence systems Multilingual menu and allergen applications Safety Notice Food allergen identification is safety-critical. Although this dataset has undergone multiple automated validation stages, including deterministic rule-based detection and LLM-based auditing, it should not be treated as a substitute for verified manufacturer ingredient declarations, official allergen documentation, or professional food-safety procedures. Ingredient formulations may vary by manufacturer, country, preparation method, and time. Production systems using this dataset should include additional validation and appropriate food-safety safeguards. Credits Original recipe data is primarily derived from RecipeNLG. Dataset selection, restaurant-menu adaptation, ingredient extraction, ingredient normalization, allergen detection, validation, and final dataset preparation: [Ömer Faruk ŞAHAN / Hugging Face omerfsahan]