Posts tonen met het label foodmap. Alle posts tonen
Posts tonen met het label foodmap. Alle posts tonen

woensdag 24 december 2014

Chef Watson: reciparrhea

Earlier I wrote about IBM's attempt at computational gastronomy, finding it a bit of a trainwreck. Recently I have been accepted as a Beta-tester for their Chef Watson, an online program that helps you create novel recipes calculated from ingredient relationships culled from 1000ands of recipes. The exact mechanisms are kept under wraps. Every time I read their description of it as "a system that could reason about flavor the same way a person uses their palate by capturing tens of thousands of existing recipes through natural language processing techniques to understand ingredient pairings, ingredient-cuisine pairings and dish composition" I can't stop giggling like a second rate Jonathan Creek but still, I can't help being fascinated.


Here is how you start, let's see what we can do with broccoli.



Watson suggests matching ingredients, dishes and cuisines. It seems that the style is optional but the dish mandatory to proceed to the recipe. Notice that these suggestions are in classic mode and the top matching ingredient is butter. Open the creativity notch a bit and the suggestions change with it:



What happens I think is that it works on frequency counts of ingredient pairs. Whatever you do with your broccoli it will involve butter at some point making it the most associated ingredient and therefore the most classic. It begs the question if butter really is an ingredient you would use as a key component of a dish. Further proof of Watson selecting ingredients on frequency comes when we are selecting for 'surprise' as much as possible:


Now there is some weird vinegar at top but look at the second one: first it was black pepper and now it is black peppercorns. This is the same ingredient but named slightly different which eludes the program. Mustard will be used in conjunction with broccoli often but rare are the recipes suggesting Dijon mustard and consequently it becomes a novelty ingredient for experimental chefs. If you would force all these variations into one the number of possible recipes would shrink enormously. I have checked if these suggestions are explainable by foodpairing based on aroma compounds and the answer is: no. So this based on recipe predominantly.

While you are selecting the ingredients, styles and dishes Watson gives you plenty of info, as you can see.




Add a few more ingredients and generate the recipe:



This is not all, the steps go on after the screenshot. It is a lot of text and by changing the slide at the top there are a number of variations of this recipes (50? 100?) to be explored. I think you will need the patience and the free time of a monk to evaluate them all and that is just for one set of ingredients. Wisely IBM has added the following disclaimer:

"Remember that Chef Watson eats data, not real food. The ingredients and steps are suggestions, so be sure to use your own judgement when preparing these dishes. And, give us feedback to make the Chef smarter."

If you want a bit of fun it can create recipes for things like: Indian lemongrass bouillabaisse, Korean turnip stroganoff cheesecake and French almond milk tiramisu pancake. The biggest problem with Chef Watson is that food is not about data but about memory and place, company and good times. It generates data but it fails to translate into an experience. It only goes to show that every Watson needs a Livingstone.

zaterdag 4 oktober 2014

AEAR (Average Etymological Age of a Recipe)

One can take a random recipe, like Jamie 'proper delish' Oliver's rainbow salad wrap, and look up the year each ingredient entered the English language. It would result in the following etymological timetable:

  

With this data you are able to calculate the AEAR or Average Etymological Age of a Recipe. As the word 'average' says it is derived at by dividing the grand total of years by the number of ingredients. For Oliver's salad wrap the AEAR is a respectable 1329. It is bogus, of course, but it is a way to add a metric to recipes (or entire cookbooks) that few will have experimented with. With good reason I hear you say.

The following graph shows the AEAR of 77 historic cookbooks published between 1390 and 1936. In those 546 years the AEAR went up with only 220 years. The vertical line is for AEAR, horizontal is for year of publication of the cookbook.


For the period after 1936 cookbooks within the public domain are scarce but for with a little help from our friends from the Pirate Bay we can add Nigella Lawson's Express (2007). The trend line does not move visibly but the book is way above the trend. She scores a AEAR of 1359. Between 1390 and 2007 (so between the Forme of Cury and Nigella Lawson), a period of 617 years the AEAR went up 326 years. These numbers one could once again compile to calculate relative growth rates per decade or century but this I will leave to a PhD with the time and the inclination who can than proceed to theorize about punctuated etymological equilibriums. 


The challenge is this: who can find the newest and the oldest recipe as measured by AEAR? 


Can you beat the AEAR of this recipe for "Teriyaki tofu wrap with macadamia roasted garlic spread" which is an impressive 1461?!

Map your Recipe can calculate.

dinsdag 20 mei 2014

Rene Redzepi and Alfred W. Crosby

Yarrow (Gerarde 1597)

To most people the common yarrow will be a weedy roadside plant best kept out of the garden. It is easy to overlook that this humble plant was a witness to all of the 'Rise of the West' (McNeill). Its botanical name refers to Achilles who purportedly took it along as an antibiotic on his travels, the Norse introduced it to Greenland about 1000AD and it is now common in large parts of the world.

Yarrow also features as a foraged green in Rene Redzepi's NOMA kitchen where it is a common ingredient. It is also included several times in Redzepi's tome: 'Noma: Time and Place in Nordic Cuisine' (2010). Out of thin air, despite its generalist cosmopolitanism, Yarrow (or bloodwort or milfoil) was made to stand as a symbol of environmental awareness, hyper-regionality and creative idealism, a pawn in the battle for global food security and Michelin Stars. Yes the yarrow is local but it is local to, back of the envelope calculation, everybody living in the temperate zone. This is a pattern, not just a particular aspect of yarrow which is actually a very bad example as the new world already possessed yarrow, a variation with a genetic link so close that it continues to baffle taxonomists. 

The foraging locavore (from Euell Gibbons to Richard Mabey) is almost always subsisting on plants that have long ago left their natural boundaries and gone global. Yarrow, nettle, dandelion, cowslip, garlic mustard, chickweed and sorrel, all used at NOMA, are all extremely hardy and thrive on human disturbance. These are plants that were introduced to the Americas and Australia as a consequence of European farming practices, as so well described by Alfred W. Crosby in The Columbian Exchange (1972) and Ecological Imperialism (1986).

The ironies are several. Regionality is celebrated by making use of plants that have gone global (making it possible for a cook in New Zealand to reproduce a Nordic recipe). The chef who made his stake claiming that at least one third of his ingredients was foraged is relying heavily on plants associated with farming to do so. The plants that are used to make his food 'distinct' are some of the commonest plants on earth. The dandelion, after all, is the plant on which the sun never sets (Crosby).

Redzepi is famous for not using olive oil as the token symbol of him turning his back on the high tradition of French cuisine. When running the entire ingredient list of the NOMA book through Map Your Recipe you would expect a large part of the plant-ingredients to be domesticated in the Euro-Siberia center. A relatively small center missing from the original scheme proposed by Vavilov but added by his students. It is the origin of such plants as kale and kohlrabi. It has those but the book includes ingredients originally domesticated in every global center of diversity bar Tropical Africa and Australia, just like the Big Mac:


Earlier I already reported that food pairing visualizations may suggest that Redzepi still thinks like a classical (read French) chef. The abundance of plants domesticated in the Mediterranean also confirms this.
I am not a geo-food fundamentalist; there is no cuisine in the world that does not make use of globalized plant resources (perhaps only apart from the one you find in the Eskimo Cookbook). Cooking is culture not nature and the concept of an evasive plant makes no culinary sense. This is not meant to detract from Redzepi's project, which I continue to find admirable, but it is meant to remind us of the fact that in a globalized, anthropogenic landscape every claim made about regionality needs to be understood and evaluated against a backdrop of global environmental transformation.


World history weighs in on every locality on the planet, plants tells that story.

zaterdag 10 mei 2014

Food pairing / gastronomy with a telescope

The theory of food pairing inspires little faith (see earlier) but when moving away from culinary applications perhaps it can be used to differentiate cuisines and cooking styles. How Chinese is Jamie Oliver? How similar are Mexican and Indian cuisines? How do French and Indian cooking differ? How unique is Rene Redzepi? 

The aim is to find a way to reveal the inner structure and logic of a cuisine, if such a thing exists, by comparing the way a cuisine or a cook combines ingredients with other cuisines and cooks. The first step is turn a collection recipes (a cookbook) into ingredient pairs, here is what a fragment of a looks like:
potato,pork,2
chicken,cucumber,1
chicken,grapeseed,15
chicken,milk,6
chicken,onion,9
chicken,pork,3
cucumber,grapeseed,3
cucumber,onion,2
cucumber,pork,2
grapeseed,milk,10
grapeseed,onion,11
grapeseed,pork,4
milk,onion,2
milk,pork,1
Two recipes use both potato and pork, one recipe combine chicken and cucumber, 15 recipes combine chicken with grapeseed oil and so on down the list. In a graph the pairs look like this:

The problem is in the data more than in the code. To get to lists of ingredients as recipes that are easy to process I am using Eat Your Books, a website that catalogs recipes and cookbooks. The ingredient lists are not complete (what exactly are 'cupboard ingredients'? a reference to the mock turtles of the soup) but they will do for my purpose.

Here is the graph of 'An Invitation to Indian Cooking' by Madhur Jaffrey (1975). It is pretty much what you would expect, a chaotic self-referential hairball with the core ingredients in the center with the rarer or less staple ingredients pushed to the edge. All graphs can be enlarged, the real information however is in the shape of the graph, not in the name of ingredients.


A different projection shows the connections differently, clearer on the eyes but not necessarily better: 
If you were creating something that would generate options for chefs you could take a book like "French Home Cooking: An Introduction to Classic French Cooking" by Paul Bocuse (1989) to generate diagrams like the following that shows what Indian (blue) and French (red) cuisines combine with potato and carrots.
It is of course bad practise to use one cookbook as representing an entire cuisine, but we are here in illustrative mode. Indian and French cuisine are national cuisines; how do they compare with someone like Rene Redzepi. With what ingredients does he (in green) combine the humble potato and carrot in his book "Noma: Time and  Place in Nordic Cuisine" (2010)? I a French manner.


But from the perspective of dry cooking this is still puny and close to home. The next image compares French and Chinese cuisines. The French is the Bucase book (blue), the Chinese (red) is Ken Hom's "A Taste of China" (1990). Again we are not actually comparing cuisines but cookbooks representing a certain regional form of cooking to a Western audience but the differences are real. Chinese and French cooking are worlds apart and only share some basics like vinegar, onion and pork. Chinese cooking comes across as much more homogenous and compact.

Now add Jamie Oliver's "The Naked Chef" (2000) to this French/Chinese data and see what happens: Jamie Oliver's cuisine is like a giant flesh eating amoeba devouring both cuisines whole and it still remains hungry. For now it is seems more French then Chinese.
Here is what happens when comparing Rene Redzepi (red) and Jamie Oliver. Even though the two appear to be opposites (the wild vs the supermarket, the avant-garde vs the popular) this graph does not really show it as you can see by the overlap. Both are Western chefs cooking Western food even when many ingredients are not shared.

The next image returns to the observation that Indian and Mexican food are historic twins. Would food pairing confirm this? Comparing Jaffrey (blue) with "Rosa's New Mexican Table" by Roberto Santibañez (2010) resulted in the following. The two cuisines are structured as separate spheres with a few heavily contested ingredients. Ingredients do not a cuisine make, as Rachel Laudan would possibly say as this graph seems to say.
 

In conclusion, to show that two similar bodies of recipes will overlap, I have compared Jaffrey with "50 Great Curries of India: Tenth Anniversary Edition" by Camellia Panjabi (2006). Both writers are of course using different ingredients but this image, in combination with the images above, do suggest a metric of displacement and uniformity: similar recipes will generate similar and overlapping hairballs.
 
 

donderdag 24 april 2014

The Phantom Recipe Constructor [notes on food pairing](mini_edit 1)

Over Easter I have been putting together a new page for Foodmap that allows the user to select 3 ingredients from a list (and/or 3 randomly chosen ones) to find out what foodstuffs are commonly used in combination with it. Optionally it can also display for some ingredients what odor compounds they contain. You might of heard of this as Food Pairing, a theory coming from within molecular gastronomy HQ that states that "foods combine well with one another when they share key flavor components". The ur-example is white chocolade with caviar.

Ever the keen student of Horace Walpole I named the project the Phantom Recipe Constructor and for me it was mostly the challenge of Proof of Concept: could I get the data into manageable shape and would it work as a service.

The question of whether it's working I will leave to your discretion. I would here like to share my reservations about the data, my use of it and the food pairing theory itself.

There are two sources of data:

- Flavornet, a website where some brave soul plowed through the scientific literature to create "a compilation of aroma compounds found in human odor space". I believe that these are the flacor components food scientists are using to pair foods that could be expected to taste well.

- A file with 220.000+ food pairs taken from a file provided as an extra to the 2011 paper 'Flavor network and the principles of food pairing' by Ahn, Ahnert, Bagrow and Barabási. In this they analyze 56,498 recipes from two US recipe repositories (Allrecipes and Epicurious) and a Korean one (Menupan). The latter "to avoid a distinctly Western interpretation of the world's cuisine", which is important but I wonder if Korean cuisine is not too much of a minority cuisine to be representative of anything but itself: its skews the results. Another issue is that some common ingredients are missing or underrepresented. Spinach has only 4 appearances and that is in dried form (never heard of before, maybe a Korean delicacy). Gherkin, eggplant, alfalfa, couscous are all not present. Not a major deal, but important to keep in mind. I use Allrecipes quite a bit when looking for example recipes for specific cuisines (Filipino say) and it is a great resource but once it is parsed straight and verbatim into a database to represent something larger than itself I wonder if its collections of family recipes and the latest inventions of amateur cook can live up to this claim. Not that I would know how to tackle this problem of representation: any recipe collection represents a paper reality and never really touches on what people actually eat. 

What the authors have done to collect recipes is as any programmer would solve the problem but I doubt if a historian would be satisfied with this make-do approach to data. There are a huge number of historic, out of copyright cookbooks available and if these could be processed and added to this data, classic flavor combinations might be better represented. It might even be used to trace changing tastes through the centuries. The data also has the huge gap of Indian and Chinese cuisines: the food of over 2 billion people is underrepresented. Adding all of the world's cuisine to a database would however also be a bad idea if it would not allow you to trace differences within culinary traditions, especially as tradition fall apart once you look closer. A workable solution would be to attempt to represent tiny sections of the food spectrum: food pairs of French cuisine between 1880 and 1940, food pairs of bestselling cookbooks in the 1980ties, food pairs in Anglo-Indian cuisine since 1800 and so on.

To add stupidity to the mix I have filtered (got rid of the pairs with a frequency less than 4) and butchered the data (turning boiled, cooked, fried and raw potato into one item: potato) to make it workable within the constraints of a webservice. I would need to look at it properly but I actually think that preparation method is a minor and/or random differentiator in this contect. If you select 3 ingredients, 3 random ingredients and want to see the flavor compounds your browser will show you what I mean (patience it will come). Preparation obviously does much to the taste to ingredients, this data is available in the data file but absent from the Phanton Recipe Generator.

ALL YOUR BASE ARE BELONG TO US & THE PHANTOM RECIPE CONSTRUCTOR IS FOR ENTERTAINMENT PURPOSES ONLY. 

My main problem with food pairing is that it is so horribly reductive. What tastes well shares common characteristics?! What a dull concept and a boring theory.  The presence of trimethylamine makes white cholocate and caviar taste well together? But it is a fact that comes out after the fact but might as well be explained as a random event.

Reason by analogy: A dating agency matching you with a future partner might select for you someone equally passionate about music only to find out that your tastes are far apart and incompatable. What you share is what separates you, music is not just sound, it is culture. A dating agency might not suggest a future partner because of different music tastes which may be insignificant once you would actually meet. What makes a good match is not determined by one shared commonality. It is about how differences and similarities balance and contrast each other overall. 
 
Opposites always attract: This is why the Phantom Recipe Constructor offers the reverse function: select an ingredient and it suggests what does not go with it.

The idea that flavors in a dish need to compliment each other is an implicit Western practice and Asian cuisines instinctively do the opposite. Given the ongoing and enthusiastic adaptation of Asian foods in the Western diet I predict that food pairing has little future anyway.