Autocookie
2016 August 17
Autocookie is a web app for generating new recipes. Currently it focuses on cookie recipes but you can add different types of recipes yourself.

Why?

I used to hate following recipes while baking. Then at some point I realized how much better things tasted when I did. Becoming even more of a conformist, I came to believe that the best ever recipe for chocolate chip cookies was printed on the back of the Toll House chocolate chips package. (I might still believe that.)

And then I saw Kenji's brilliant break-down of how different ingredients affect cookie attributes. Such a brute-force effort fascinated me, and I made this app to summarize his findings for quick reference. But still, I didn't improvise when I made cookies. Instead, I made the same exact cookies every single time.

Why? Because I'm not like Kenji: I would never bake something over and over again and manually note the effects of changing the proportions between flour and baking soda. I wanted something automatic—something that could tell me how much of an ingredient I could add to or subtract from a recipe before things would start to taste wrong.

So what's an Autocookie?

Autocookie collects a bunch of recipes for the same type of food—chocolate chip cookies, to start—and finds the range of acceptable ingredient ratios. To continue my flour and baking soda example, if one recipe called for 2 cups of flour and 1 tsp of baking soda, that's a ratio of 2.0 cups/tsp. If another recipe called for 1.5 cups of flour and 2 tsp of baking soda, that's a ratio of 0.75 cups/tsp. All Autocookie does, then, is suggest proportions of baking soda and flour that stay within this range of 0.75-2.0 cups/tsp. Just expand this same idea to all ingredient combinations, across multiple recipes.

Future work

Given the messiness of recipe databases, I ended up parsing my recipe ingredient lists myself. I tried the NYTimes's ingredient phrase tagger, but in my case, because I was focused on a specific type of recipes—cookies—it ended up being easier to just roll my own ingredients parser.

Though my recipe parsing is automated I decided to aim for quality over quantity (for once) and only include recipes I've sanity-checked. However, this app could be easily modified to include different types of recipes. For instructions on this, see the README here. To get the recipes themselves, you'll need access to the Yummly recipe API. (This is free and simple, if you're a student.)

One thing I've learned from working with recipe data is that there's a lot of redundancy out there. The difference between the Hershey's and Toll House chocolate chip cookie recipes, for example, is literally only 1/2 a teaspoon of salt. In a world where anyone can change ingredients by 1/2 a teaspoon and call it a new recipe, someone's got to step up and summarize all this data. A visualization like Autocookie is a start.

Some other things I would like to add in the future:

  • Better unit conversion (e.g., things like "3 tsp" should be "1 Tbsp")
  • Add/remove ingredients (my current code is too janky to support this)
  • A way to scale outputs for different serving sizes

Related work

  • Chef Watson (IBM): Suggests ingredient pairings but not quantities.
  • Michael Ohene's cookie generators: This one is paywalled; this one is not.
  • This project generates an average of all related recipes.

Autocookie was completed on August 17, 2016.