Cocktail recipes generated by neural nets

Inspired by AIweirdness, I used the open-source pretrained recurrent neural network textgenrnn to generate cocktail recipes. There are meal recipes generated by RNNs out there (Tom Brewe’s), but I was hoping that the relative simplicity of cocktails recipes would yield more realistic results. (Spoiler: not really)

I got a recipe database thanks to The Cocktail DB (I used API queries to get the recipes), which I completed with other recipes from The Webtender (this time using html scraping). The full dataset contains approximately 2000 recipes; this limitation is probably one of the main reasons for the low quality of my generated recipes. These recipes are user contributed, so there are some sentences in the dataset that are not strictly related to recipes, like “Works great for barbecues !”

Below is some data exploration: a graph representation of the ingredients appearing together in the recipes, using R and edgebundleR.

edgeb_rare_2

As for the neural network, it is incredibly simple to set up; literally 4 lines of code in Python! Here are some generated cocktails using 10 epochs and various temperatures (temperature is a kind of “creativity” parameter):

“Citrus Shot #2: 1 bottle Brandy, 1 part Tequila, 1 part Rum (Bacardi), 1 part Grenadine. Pour the sugar and sugar and sweet and stir well. Strain into glass and pour into mouth. Stir well. Drop the recipes. Fill up with granule shot.”

“Chickly Preside: 1 1/2 oz Gin, 1 oz Lime juice, 1 1/2 tsp White Creme de Menthe, 1 oz Vodka, 5 oz of specifice, 5 1/2 oz Gin, 1 whole Egg. Shake. Pour into a shot glass. Serve. ”

“Pumpard Sight: 1 1/2 tsp Grenadine, 1 tsp Cinnamon, 3 dashes Triple sec, 2 oz Sour mix, 1 splash Jägermeister. Mix all ingredients avolaxed in a shaker with ice, shaken, add the slices and coffee until the vodka. Strain and add the Irish cream and pour into shot glass. Add Bailey’s”

 

On the plus side, the network learnt the recipe format is “Name: Ingredient List. Instructions.” The principal problems that make these recipes unrealistic are the almost-systematic lack of connection between the cocktail name and the recipe (like the citrus-less 1st recipe above), inconsistent dosages (mixing “1 part” with “1 oz”), ingredients appearing in the instructions but not in the ingredients list, and repeated ingredients (“… 1 oz Gin, 2 oz Gin, 1 oz Gin …”). The repeating ingredients can be avoided by setting the neural net temperature to a higher value, but it was a fine line between conservative and gibberish. In the end, I did not suggest these recipes for my company Data Science team afterwork as I originally intended.

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s