As amusing as the results are, I can't say I'd be too happy seeing pages of search results filled with these. There's been plenty of discussion on HN about how hard it is to find good recipes and skip over the SEO spam; imagine having to determine if they're real too...
That's not enough. I have several good cookbooks (and some OK ones, and one that instructs me to have my fishmonger clean the squid). I still miss the collection I left behind when I moved out of the states.
But they don't fill the same niche. Cookbooks tend to do an excellent job teaching or introducing me to things I might not have otherwise cooked or searched for. The internet helps me when I have a specific ingredient I need to use up, if I am lowish on ingredients, or need something special that the cookbooks that I own simply don't offer. And sure, I could use cookbooks in a similar manner, but it isn't efficient and I don't always want to spend that sort of time.
I have a table in Notion where I try to put in every recipe I followed and liked the result, and it also has a column for required ingredients. That solves the specific ingredients problem, but it is a lot of effort.
If you can get over the socialist aspect of it, the BBC consistently has great recipes on its websites, and isn't even ad-supported (in some countries).
bbc.co.uk is owned and operated by Our Glorious Comrades the BBC.
bbcgoodfood.com is owned and operated by the running dogs of capitalism - Immediate Media, who are owned by Hubert Burda Media Holding.
Current Conservative government is strongly against the publicly owned bits of BBC (and of all services) and keep finding new ways to i) put huge hurdles in their way ii) complain about the lack of efficiency of the service iii) sell it off to commercial partners who are not subjected to the same regulatory hurdles.
This happened (sort of) to the BBC's food websites:
Is the BBC being paid for by taxpayers really a problem that people have? Seems like American "capitalism good, socialism bad" rubbish that non ideologues know to ignore. Why would the business structure of a website impact the quality of articles?
I think the issue people have with the BBC are that it is very much controlled by the government/elite. This is the case for most British media though - compared to the US there isn't anywhere near the level of independence.
My first thought upon seeing that comment was "there's no way a Brit wrote that".
I know the BBC has its critics here in the UK, but I've never seen any one of them conflate it with socialism before. Just reading that sentence forced me to do a double-take...
I'm sorry you feel the need to retract my nationality.
It was a joke, by the way. There are some hardcore free-market libertarians here really who do make criticisms like that. Isn't monotone sarcasm just as much a part of Britishness as the BBC?
It is, but you have to laugh out loud after you tell a joke to make sure everyone knows it's a joke.
There was something about that in The Name of the Rose- the book in any case. Something about how Englishmen and Germans react differently to a joke etc. I'll see if I can find a quote.
I'm Italian and I lived in Britain for a while. I would say there's a very large variability in quality, and it depends on the context. First of all, Brits mostly don't eat "traditional British". In Italy people eat Italian 99% of the time, and 99% of restaurants are Italian. In Britain people very much absorbed (even in home cooking) a lot of Asian cuisine, especially Indian and Chinese.
Food in supermarkets is often terrible. The selection of cheeses, fresh fruit and veg, fish in mainstream supermarkets is dreadful compared to southern Europe (or even Germany). But restaurants in UK cities are generally excellent and eating out is relatively cheap.
This said I agree that many Brits don't know how to cook. Supermarkets sell a LOT of pre-made meals. People go out a lot. But there is certainly a reinassance of millennial foodies that not only like a good international restaurant, but are also into cooking.
Try the Waitrose. I'm Greek and the best supermarket taramosalata I've ever had is from Waitrose. To clarify home-made taramosalata is cream coloured, but taramosalata sold at supermarkets is always dyed bright pink, for some reason. And that includes Greek supermarkets. The only supermarket taramosalata I've ever seen that has the right colour is the Waitrose one- and it also has the right flavour and consistency. Well ish. Nothing can ever beat my yiayia's taramosalata, but it's a good approximation.
I assume their other "ethnic" foods are also of similar good quality (for mass-produced stuff). They also have sort of decent fruit and veg and their own brand of Duchy Organic farming produce (milk, eggs, meat, fish, etc) that is actually good.
Yes but Waitrose is not widespread. It's a high-end supermarkets that you find near posh residential neighbourhoods, and not everybody can afford it. I agree that the quality there is good.
It depends on what you're buying. I haven't really looked but I think everyday goods like fresh milk and bread etc are the same price in Waitrose as in the other large chains. More specialised goods are expensive, sure. But I wouldn't buy taramosalata every day for example.
Anyway my feelings are a little bit hurt when you say that you find it in posh neighbourhoods. I'm not posh! I'm just Greek and it seems, like you, I'm used to a highest standard in food quality.
Ah, OK. Then I agree absolutely. Brits are sold very low quality stuff. A bit sad, really. And don't let me get started on the quality of fresh fruit and vegetables in this country. Honestly my diet has suffered because it's so hard to find good fruit that I really want to eat- and vegetables are just bland. Then I go back to Greece and eat something stupid like boiled zucchini and potatoes with olive oil and vinegar and I want to cry because everything has a taste.
I guess it's a huge privilege to have grown up with good quality food not just sufficient calories- and being able to eat good food a few times a year still. I freak out a bit when I think how much we can lose with climate change. But that's another discussion.
Anyway this is why I don't like to accuse the Brits of having a crap cuisine (or eating too much meat). They do, but that's because their (other) materials are not very good to begin with. If you think about it, the only stuff that grows locally are cabbage, turnips, potatoes and apples. You can only go so far with that.
I'm sure that's a major reason for all the problems this country has. Food is one of the biggest things in life, up there with companionship, sex, good wine and natural surroundings. If you don't get good food, there will always be something missing from your life.
>> For a couple of hours of training our character-level RNN model will learn basic concepts of English grammar and punctuation (I wish I could learn English that fast!).
Thankfully the task is rather easier than learning natural language concepts. The LSTM only has to learn basic concepts of the language of recipes, which is considerably simpler than unrestricted natural English.
For example, in natural English one would say
"You will need one cup of unsalted butter for this recipe, which you should soften.
Alternatively, you can measure 2 sticks of butter".
Whereas a recipe will simply say:
1 cup (2 sticks) unsalted butter, softened
As in the example on the repository.
Also, it seems that most, if not all, sentences begin with a verb that describes an action followed by a list of ingredients to be combined. "Stir the olive oil, garlic, thyme and 1 teaspoon salt in a saucepan;" etc. The regularity and repetitiveness of such structures makes them much easier to learn than arbitrary English text. In more practical terms, they also make the instance space for this task a lot more dense than arbitrary English text, were a sentence with a certain structure may only repeat once after a million utterances.
Edit: OK, if I don't say this I'll explode. "one cup" is "two sticks"? This is just not going to work.
I find it interesting that the model doesn't get one of the simplest rule of a recipe: the ingredients list and the ingredients in the instructions must be the same.
Obviously, it is because the model "understands" the structure of the sentence, but is oblivious of the text as a whole.
I get that this was just a toy, but naturally I wanted to think through how to make it useful. Like imagining building a real car from lego.
I know very little about machine learning or cooking or chemistry in general. How would one make this actually useful and interesting?
My guess is you would need to provide a lot more context to the database. Things like chemical composition seem like the most fundamental component of recipes.
Backwards planning from the composition, you could teach it actions that generate those chemicals such as methods of cooking, and the source foods that provide the building blocks i.e. ingredients.
Then at some point you could link it back to the recipes to create standardized instructions for generating certain chemical patterns.
Does that sound like the right way to make this more realistic?
Related I worked on a real project that used a database of recipes and nutritional information to build varied meal plans to meet certain dietary requirements and goals.
We used a linear solver and added a lot heuristics e.g. what time of day certain recipes were 'acceptible' suggestions. We also needed a lot variants e.g. proportions to meet kJ targets.
That's not how neural networks er work. This one is trained to predict the next character in a sequence. It's trained on raw, unstructured text, not high-level concepts like "chemical composition" or "actions that generate chemicals" etc. Its inputs are character sequences and its outputs are character sequences. There is no way to "provide context to the database" (there is no database, just character sequences) or anything like that. If any relations like that are useful to its task of predicting the next character then your best hope is that it will somehow magickally learn them from its input text. Otherwise, the knowlede of how cooking works will simply not be encoded in its trained model.
I don't know enough about machine learning to specify which neural network type is correct for a given use case or which algorithm gets the most relevant results, but I do know enough to use them for things once an engineer hands me the tool.
I'm not talking about how this specific network is trained. I'm talking about how this toy could be perhaps turned into something useful, like my original analogy to building a car out of lego.
I understand enough about neural networks to know they are useful as Boolean supersets. It's all about how the training is defined with your training data containing the Boolean true/false values.
So what I'm saying is, in order to provide context and make this toy useful, you could change your Boolean choices from sequence-based letter chains to something with a little more value like popular chemical combinations.
To go further, consider how a restaurant picks its menu. That is a simple Boolean statement of "accept" or "reject". So how do you work backwards from there? Right now you require a combination of a head chef that has years of experience (your database) and an owner that has a vision.
I'm sorry, I think you took my comment in the wrong way. I didn't mean it as some kind of put down. I wished to explain how this kind of thing works.
In the same spirit, of a friendly sharing of knowledge, I would also now explain that what you are proposing, "buildig a car out of lego", or in general assembling structure out of modular components, is not what neural nets do best. Neural nets are best at mapping between sets of objects. Typically, one set represents some entities we are interested to categorise and the other set represents the categories to which we want to assign the entities in the first set. To "build a car out of lego" you would need a different type of AI, like a program synthesis algorithm, or an Inductive Programming algorithm (machine learning algorithms that learn programs from examples; and which I study). In such a setting, your "lego" would be functions or sub-programs and your "car" would be a program created by combinations of the given sub-programs.
Also, neural nets, especially more modern ones of the "deep learning" variety are not limited to boolean features ("data containing Boolean true/false values") and can instead be trained on arbitrary real-valued data. What is often done when training language models is to encode training data in a "one-hot encoding" manner, in which the "features" are very long boolean vectors, with one element for each word or character in the raw text and with a "0" representing "no occurrence" and a "1" "occurrence", of a particular character or word. This is not the case for other types of data, e.g. in machine vision the feature values are raw pixel data, in time series regression they're arbitrary precision real numbers etc.
I confess that I'm not sure how the data looks for neural nets trained to predict chemical structures. It's possible they're one-hot encoded vectors, like for text.
No doubt you can train a neural net classifier to make yes/no decisions about possible items on a menu, but my guess is that a system of this kind would look at customer preferences primarily, rather than the chemical composition of food items. After all, the chemical composition of a dish will vary a lot more than the preference of a particular individual, or group of individuals, for that dish. By which I mean, if I like spaghetti carbonara, I will probably like it regardless of its exact chemical composition, but I won't like it. e.g. if it lacks pancetta. My guess is that the relevant elements of the dish are in the scale of cooking ingredients, rather than the scale of molecules. So a system like the one you describe would be better off taking into account the composition of a dish on that scale.
On the other hand, if you wanted to assemble a menu with finished dishes from a list of ingredients and examples of recipes, then you would need a system like the ones I describe above, in the program synthesis or (preferrably) Inductive Programming category. Or of course you could write a program encoding the rules you have in mind by hand. This is not a task where AI is absolutely necessary, I feel.
You're right in that you'd need to teach the system more than just ingredient lists.
I would go even further: It's not enough for the system to know how to generate any given "chemical pattern", but to also know which chemical patterns are desirable.
It seems to be missing the three page back story of how the author meet her husband on a last minute discount vacation to Uganda and how they had to seek shelter at a local tribes man who made her this exact burger in the back of his 1984 Toyota HiAce.
It's probably a matter of time until a restaurant gets a Michelin star through AI recipes. Unlikely but tasty juxtapositions are big in trendy, high-end cuisine, as are "fusion" restaurants mixing two unrelated cuisines (yuzu all the things!), and AI seems like it would excel at finding these, hopefully with a bit of human quality control.
I sometimes cook things because they seem weird or make me curious. It is definitely an achievement. It doesn't mean they aren't stellar, workable recipes by any means: Historical recipes (or even old ones from 50-70 years ago) are often weird. And workable, though if they get old enough, you have to fill in some blanks since they assume the cook is experienced more than modern recipes do. And some of the things are absolutely stellar. If you don't want to go historical, go sideways to different cultures - especially fusion foods. Indian-spiced potatoes, bell peppers, and some cheese stuff into bread cinnamon-roll-style? Yes please.
Right now, AI recipes are just an oddity. Weird and barely workable at best, and that's OK. We'll get there.
I like this, although it is yet another example of a learned language model not capturing underlying meaning.
I started a similar project last year, but using GAN (RecipeGAN). Using a GAN would learn underlying meaning, based on my experience using GANs to synthesize data that maintained univariate statistics and correlation between features of the original data.
The example in the article shows how RNNs can capture structure (I have used LSTM models to synthesize JSON data, and just for fun, to model source code).
Clock is ticking before we get the first 'AI Restaurant' where you have to eat the Chef special and the Chef is code. Might work for the novelty factor as a pop-up that moves around, could be a way to get people into the tech.
I think generating a final 'cooked recipe' image and publishing it to the social media would attract more eyes, but that would involve whole lot of other variables and could become WMD for the recipe video spammers/scammers.
What are you trying to cook? fried onions
Hmm. Never heard of fried onions. I guess it's some kind of salad? How about:
Ingredients
1 oz. onion
3/4 tsp clove
1 oz. swiss cheese
1 cups lima beans
2 cups tomato juice
3/4 liters goat milk
Preparation
start with a large mixing bowl.
chop onion, removing any seeds, and stir in.
season with clove.
crumble over swiss cheese.
stir in lima beans (fresh).
apply dressing made by blending goat milk and tomato juice.
toss thoroughly.
Serves
2, at 1050 calories per serving.
More context? What is this, how and why was it made, etc?
Edit: aAAAAAAH! I don't want to know what it is. INSECTOID BUTTONS. AAAH.
Hmm. Never heard of hacker news. I guess it's some kind of baked dish? How about:
Ingredients
1 1/2 liters simple syrup
1 tbsp mother of vinegar
3 cups white flour
2 large salmon eggs
2 1/2 oz. american cheese
1 1/2 tbsp star anise
1 oz. pork chops
7 cups chicken breast
9 cups kiwifruit juice
3/4 cups water