# Recipe Generation Model

**URL:** <https://discuss.huggingface.co/t/recipe-generation-model/7475>\
**Category:** Flax/JAX Projects\
**Created:** [June 28, 2021, 12:32am UTC](https://discuss.huggingface.co/t/recipe-generation-model/7475 "2021-06-28T00:32:25Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![nbroad](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/nbroad/32/26465_2.png) [@nbroad](https://discuss.huggingface.co/u/nbroad)\
**Post date:** [June 28, 2021, 12:32am UTC](https://discuss.huggingface.co/t/recipe-generation-model/7475/1 "2021-06-28T00:32:25Z")

</div>

Description:  
Given a list of ingredients, generate a recipe – similar to what the GPT3 API offers: [openAI recipe generator](https://beta.openai.com/examples/default-recipe-generator). A [model exists on the hub that does Recipe NLG](https://huggingface.co/mbien/recipenlg), but it uses a GPT2 architecture. I’m curious if T5 or Bart will produce better results.

Model:  
T5 or Bart.

Dataset:  
Recipe NLG (2,231,142 recipe examples) - [hugging face link](https://huggingface.co/datasets/recipe_nlg) - [download site](https://recipenlg.cs.put.poznan.pl/)

Data example:

> {‘NER’: ‘[“oyster crackers”, “salad dressing”, “lemon pepper”, “dill weed”, “garlic powder”, “salad oil”]’,  
> ‘Unnamed: 0’: 1000,  
> ‘directions’: ‘[“Combine salad dressing mix and oil.”, “Add dill weed, garlic powder and lemon pepper.”, “Pour over crackers; stir to coat.”, “Place in warm oven.”, “Use very low temperature for 15 to 20 minutes.”]’,  
> ‘ingredients’: ‘[“12 to 16 oz. plain oyster crackers”, “1 pkg. Hidden Valley Ranch salad dressing mix”, “1/4 tsp. lemon pepper”, “1/2 to 1 tsp. dill weed”, “1/4 tsp. garlic powder”, “3/4 to 1 c. salad oil”]’,  
> ‘link’: ‘[www.cookbooks.com/Recipe-Details.aspx?id=648947](http://www.cookbooks.com/Recipe-Details.aspx?id=648947)’,  
> ‘source’: ‘Gathered’,  
> ‘title’: ‘Hidden Valley Ranch Oyster Crackers’}

Script:

Maybe [run\_summarization\_flax.py](https://github.com/huggingface/transformers/blob/master/examples/flax/summarization/run_summarization_flax.py) and just treat it as seq2seq?

Expected result:  
Give it a list of ingredients (e.g. sugar, flour, egg, peanut butter) and it spits out a recipe (peanut butter cookies). Useful for when you are trying to use up all those miscellaneous ingredients in your pantry and fridge!

Unfortunately I don’t think I will have the time to be able to work on this, but I thought it might be an interesting idea that someone else could run with.

Optional 1: Have it create a title for the recipe.  
Optional 2: Input the amounts of each ingredient so that it has some constraints.

---

<div class="post-metadata">

**Author:** ![patrickvonplaten](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/patrickvonplaten/32/2171_2.png) [@patrickvonplaten](https://discuss.huggingface.co/u/patrickvonplaten)\
**Post date:** [June 29, 2021, 2:28pm UTC](https://discuss.huggingface.co/t/recipe-generation-model/7475/2 "2021-06-29T14:28:01Z")

</div>

Think this a really cool and creative project idea! Would love to see this project take place! Let’s see if anyone else is interested in joining

---

<div class="post-metadata">

**Author:** ![m3hrdadfi](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/m3hrdadfi/32/18938_2.png) [@m3hrdadfi](https://discuss.huggingface.co/u/m3hrdadfi)\
**Post date:** [June 29, 2021, 4:22pm UTC](https://discuss.huggingface.co/t/recipe-generation-model/7475/3 "2021-06-29T16:22:29Z")

</div>

@patrickvonplaten, I believe too!

I’ve done something similar using T5 and ByT5 by PyTorch, the results were considerable, but in reality, the recipes were very similar. For instance, the models could understand and generate recipes based on either the ingredients used for warm foods or cold foods. However, the generated recipe for every ingredient (as the basis of warm or cold foods) was approximately the same procedure with different combinations and arrangements in words and steps.

I haven’t tested the GPT (2-3) yet, but I believe that the results might be better than T5 derivatives.

Note: I’ve used two datasets, Recipe NLG provided by Poland University and a custom crawled from Yummly.

I hope this one is considered a potential project. I can share the cleaned dataset crawled from Yummly (~8K food recipes).

---

<div class="post-metadata">

**Author:** ![patrickvonplaten](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/patrickvonplaten/32/2171_2.png) [@patrickvonplaten](https://discuss.huggingface.co/u/patrickvonplaten)\
**Post date:** [June 30, 2021, 12:46pm UTC](https://discuss.huggingface.co/t/recipe-generation-model/7475/4 "2021-06-30T12:46:20Z")

</div>

would you like to join @m3hrdadfi ? Think this is a cool project and shouldn’t be too time-consuming 🙂

---

<div class="post-metadata">

**Author:** ![m3hrdadfi](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/m3hrdadfi/32/18938_2.png) [@m3hrdadfi](https://discuss.huggingface.co/u/m3hrdadfi)\
**Post date:** [June 30, 2021, 12:52pm UTC](https://discuss.huggingface.co/t/recipe-generation-model/7475/5 "2021-06-30T12:52:47Z")

</div>

I’m not sure about time management, but I think I can handle it! So, yes, I’d like to join. 😊

---

<div class="post-metadata">

**Author:** ![patrickvonplaten](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/patrickvonplaten/32/2171_2.png) [@patrickvonplaten](https://discuss.huggingface.co/u/patrickvonplaten)\
**Post date:** [June 30, 2021, 12:53pm UTC](https://discuss.huggingface.co/t/recipe-generation-model/7475/6 "2021-06-30T12:53:58Z")

</div>

Wuhuu! I’ve worked a lot with T5 so in case you want to use this model, I’m sure I can help you as well!

---

<div class="post-metadata">

**Author:** ![m3hrdadfi](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/m3hrdadfi/32/18938_2.png) [@m3hrdadfi](https://discuss.huggingface.co/u/m3hrdadfi)\
**Post date:** [June 30, 2021, 12:54pm UTC](https://discuss.huggingface.co/t/recipe-generation-model/7475/7 "2021-06-30T12:54:44Z")

</div>

That would be perfect!

---

<div class="post-metadata">

**Author:** ![hassiahk](https://avatars.discourse-cdn.com/v4/letter/h/a5b964/32.png) [@hassiahk](https://discuss.huggingface.co/u/hassiahk)\
**Post date:** [June 30, 2021, 2:00pm UTC](https://discuss.huggingface.co/t/recipe-generation-model/7475/8 "2021-06-30T14:00:31Z")

</div>

This looks like a real cool project. Can I join as well?

---

<div class="post-metadata">

**Author:** ![m3hrdadfi](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/m3hrdadfi/32/18938_2.png) [@m3hrdadfi](https://discuss.huggingface.co/u/m3hrdadfi)\
**Post date:** [June 30, 2021, 2:03pm UTC](https://discuss.huggingface.co/t/recipe-generation-model/7475/9 "2021-06-30T14:03:16Z")

</div>

Sure, you are welcome!

---

<div class="post-metadata">

**Author:** ![rays2pix](https://avatars.discourse-cdn.com/v4/letter/r/94ad74/32.png) [@rays2pix](https://discuss.huggingface.co/u/rays2pix)\
**Post date:** [June 30, 2021, 5:21pm UTC](https://discuss.huggingface.co/t/recipe-generation-model/7475/10 "2021-06-30T17:21:18Z")

</div>

Task looks interesting, can I join as well?

---

<div class="post-metadata">

**Author:** ![m3hrdadfi](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/m3hrdadfi/32/18938_2.png) [@m3hrdadfi](https://discuss.huggingface.co/u/m3hrdadfi)\
**Post date:** [July 1, 2021, 5:17am UTC](https://discuss.huggingface.co/t/recipe-generation-model/7475/11 "2021-07-01T05:17:45Z")

</div>

Sure, happy to have you in this fantastic project!

🔔 I totally forgot to drop an update. I created a channel yesterday on Discord (#recipe-generation) and a public repo (mentioned in the track). After the critical online talks today, we will discuss the aspects of the project and divide the tasks in order to share this awesome model with the world.

---

<div class="post-metadata">

**Author:** ![patrickvonplaten](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/patrickvonplaten/32/2171_2.png) [@patrickvonplaten](https://discuss.huggingface.co/u/patrickvonplaten)\
**Post date:** [July 1, 2021, 10:01am UTC](https://discuss.huggingface.co/t/recipe-generation-model/7475/12 "2021-07-01T10:01:57Z")

</div>

Awesome, team of 4 now!

---

<div class="post-metadata">

**Author:** ![dk-crazydiv](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/dk-crazydiv/32/3071_2.png) [@dk-crazydiv](https://discuss.huggingface.co/u/dk-crazydiv)\
**Post date:** [July 2, 2021, 10:45am UTC](https://discuss.huggingface.co/t/recipe-generation-model/7475/13 "2021-07-02T10:45:55Z")

</div>

I’d like to join-in as well. Joined the discord channel already.
