ResearchPublication
FoodBERT: a meta-data enrichment pipeline for restaurant menus
Earlier work, a post written in 2022 by two people at Prosus and two at iFood. A Portuguese language model is trained further on recipes and menu descriptions, and models built on it describe the dishes in a food delivery catalog.

Where this comes from
This is a post on the Prosus AI Tech Blog, published in May 2022 and written by two authors at Prosus and two at iFood, a food delivery company in Latin America backed by Prosus. It reports work on iFood’s catalog, and it is listed here as earlier work with authors from Prosus. What follows is from the post.
What the post asks
Searching food delivery platforms in the Netherlands for a veggie burger with tofu and without coriander, the authors usually got a long list of burger restaurants. Search probably matches keywords, the post explains, and misses a dish whose description leaves them out. Recommendations suffer too: a platform that does not know which dishes are vegetarian cannot easily tell which of its customers are.
Describing every item by hand, in menus that keep changing, is slow work, so the authors set out to do it with machine learning. Wrong descriptions can upset customers far more than missing ones, so the predictions had to be accurate. The team’s earlier work with BERT, including FinBERT, gave them confidence that a few thousand labeled examples could be enough.
A language model for food
The work used the items’ text, with tabular data where appropriate, and left their pictures for a later round. The authors started from a general Portuguese BERT model and gathered a corpus about food: around 300 thousand Portuguese recipes collected from public websites, and over a million descriptions of items in iFood’s catalog. They trained the model further on this corpus with BERT’s masked language modeling task, so that it would adapt to the food domain. The result is FoodBERT.
Models on top of FoodBERT
The authors trained different models on top of FoodBERT, choosing each one’s type to fit the data at hand and what the task required.
- The dish type classifier says what an item includes, such as a main course, a side dish, a drink or a dessert. It was fine-tuned on a few thousand examples labeled in house.
- The dish tagger marks an item as vegan, vegetarian, red meat, poultry, seafood or dairy. It began from labels set by keywords, so that beef meant red meat, and was then corrected on a few thousand of its own predictions and trained again, several times over.
- The content parser picks out ingredients, sauces, preparation methods, sizes and amounts, and food labels from a description, a task of named entity recognition. It learned from descriptions annotated in house and from structured data in the public recipes.
- The taxonomy classifier sorts items into 72 groups, such as pizza, pasta or burgers. A strong model already did this, and FoodBERT was tried on it out of curiosity.
- The ingredient predictor predicts what is in a dish, including what its description does not mention. It learned from the names and ingredients of around 300 thousand public recipes. iFood’s menu text is more irregular, with brand names and promotions mixed in, so the content parser first strips it to the words about food.
What it found
- average accuracy of the dish type classifier
- Over 90%
- gain in weighted F1 for the taxonomy classifier over the existing model, built on TF-IDF vectors
- 5 points
The post reports figures for these two models. The dish type classifier most often mixed up side dishes and main courses, since some dishes are served as either. Ingredients were the hardest task: what is really in a dish is close to impossible to collect, since labelers cannot know it for certain and asking restaurants at scale is not practical.
The authors conclude that “a modest labelling effort, coupled with the power of language models can go a long way in extracting rich information from text”, and that what FoodBERT extracted went on to serve many other uses, some of them not planned at the start.
The post
FoodBERT: A Meta-Data Enrichment Pipeline for Restaurant MenusZulkuf Genc, Dogu Tan Araci, Vitor Oliveira, Gabriel Campos. Prosus AI Tech Blog, 2022Authors
Zülküf Genç
Director of AI, Prosus
Dogu Araci
Vitor Oliveira
Gabriel Campos
References
- FoodBERT: A Meta-Data Enrichment Pipeline for Restaurant MenusZulkuf Genc, Dogu Tan Araci, Vitor Oliveira, Gabriel Campos. Prosus AI Tech Blog, Medium, 12 May 2022
- FoodBERT: a meta-data enrichment pipeline for restaurant menusZulkuf Genc, Dogu Tan Araci, Vitor Oliveira, Gabriel Campos. Prosus, 12 May 2022
- BERTimbau Base (neuralmind/bert-base-portuguese-cased)Hugging Face