3 ms·
>> 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 th
by YeGoblynQueenne 6y ago
>> 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.
- 131012 6y agoI 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.