omerfsahan commited on
Commit
4f5eb26
·
verified ·
1 Parent(s): 6c2510c

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +151 -3
README.md CHANGED
@@ -1,3 +1,151 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Restaurant Menu Ingredient & EU Allergen Dataset
2
+
3
+ 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**.
4
+
5
+ ## Data Source
6
+
7
+ The dataset is primarily derived from **RecipeNLG**, a large-scale collection containing approximately **2.3 million recipes**.
8
+
9
+ 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.
10
+
11
+ 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.
12
+
13
+ ## Data Preparation
14
+
15
+ The original RecipeNLG ingredient descriptions often contain quantities, measurement units, package sizes, and preparation instructions.
16
+
17
+ A Gemini-based ingredient extraction pipeline was used to convert these raw ingredient descriptions into cleaner ingredient identities.
18
+
19
+ For example:
20
+
21
+ `2 cups shredded cheddar cheese`
22
+
23
+ becomes:
24
+
25
+ `cheddar cheese`
26
+
27
+ The extraction process was designed to preserve the actual ingredient identity while separating:
28
+
29
+ - Main ingredients
30
+ - Optional ingredients
31
+ - Alternative ingredient groups
32
+
33
+ After ingredient cleaning, an initial allergen detection stage was performed using a deterministic **NLP / regex-based rule system**.
34
+
35
+ The rule system considered both direct allergen ingredients and established compound foods such as:
36
+
37
+ - Soy sauce
38
+ - Mayonnaise
39
+ - Hummus
40
+ - Tahini
41
+ - Pesto
42
+ - Worcestershire sauce
43
+ - Oyster sauce
44
+ - Fish sauce
45
+
46
+ False-positive cases were also handled, such as coconut milk, oyster mushrooms, eggplant, nutmeg, and other potentially misleading ingredient names.
47
+
48
+ ## Final Allergen Audit
49
+
50
+ The allergen labels were subsequently reviewed using the **Gemini 3.5 Flash API**.
51
+
52
+ The model was instructed to use culinary knowledge rather than simple keyword matching and to consider:
53
+
54
+ - Hidden allergens in compound ingredients
55
+ - Traditional food compositions
56
+ - Explicit allergen-free variants
57
+ - False-positive cases
58
+ - Ambiguous ingredients
59
+ - EU allergen definitions
60
+
61
+ When an allergen set was considered incorrect, the complete corrected allergen set was returned and applied to the dataset.
62
+
63
+ 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.
64
+
65
+ ## EU 14 Allergen Labels
66
+
67
+ The dataset uses the following standardized labels:
68
+
69
+ ```text
70
+ gluten
71
+ crustaceans
72
+ eggs
73
+ fish
74
+ peanuts
75
+ soy
76
+ milk
77
+ tree_nuts
78
+ celery
79
+ mustard
80
+ sesame
81
+ sulphites
82
+ lupin
83
+ molluscs
84
+
85
+ Dataset Columns
86
+ Column Description
87
+ recipe_id Unique identifier for each recipe
88
+ title Dish or menu item name
89
+ ingredients Original raw ingredient list from the source
90
+ source Original recipe source
91
+ link Source URL when available
92
+ ingredients_clean Cleaned main ingredient names without quantities or preparation instructions
93
+ optional_ingredients Ingredients explicitly marked as optional
94
+ alternative_groups Groups of ingredients that may substitute for one another
95
+ allergens_primary EU 14 allergens detected from the main ingredient configuration
96
+ allergens_all_possible Broader allergen set that may include optional or alternative ingredients
97
+
98
+ The primary target used for allergen modeling in this project is allergens_primary.
99
+
100
+ Preparation Pipeline
101
+ RecipeNLG (~2.3M recipes)
102
+
103
+ Restaurant-oriented recipe selection
104
+
105
+ Duplicate reduction and menu-name cleaning
106
+
107
+ Gemini-based ingredient extraction
108
+
109
+ NLP / regex allergen detection
110
+
111
+ Gemini 3.5 Flash final allergen audit
112
+
113
+ Additional real lupin recipe coverage
114
+
115
+ Final dataset
116
+ Dataset Statistics
117
+ Final dataset size: 55,658 recipes
118
+ EU allergen classes: 14
119
+ Unique recipe IDs: 55,658
120
+ Primary allergen target: allergens_primary
121
+ All 14 EU allergen classes are represented
122
+ Lupin-containing recipes: 38
123
+
124
+ More detailed allergen frequency statistics can be calculated directly from the released CSV.
125
+
126
+ Intended Uses
127
+
128
+ This dataset may be useful for:
129
+
130
+ Food allergen classification
131
+ Restaurant menu analysis
132
+ Ingredient understanding
133
+ Machine learning research
134
+ Restaurant management software
135
+ Menu intelligence systems
136
+ Multilingual menu and allergen applications
137
+ Safety Notice
138
+
139
+ Food allergen identification is safety-critical.
140
+
141
+ 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.
142
+
143
+ 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.
144
+
145
+ Credits
146
+
147
+ Original recipe data is primarily derived from RecipeNLG.
148
+
149
+ Dataset selection, restaurant-menu adaptation, ingredient extraction, ingredient normalization, allergen detection, validation, and final dataset preparation:
150
+
151
+ [Ömer Faruk ŞAHAN / Hugging Face omerfsahan]