# US 2019/0171707 A1 · Systems and methods for automatic analysis of text-based food-recipes

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2019/0171707 A1
- Document ID: US20190171707A1
- Status: Published application
- Kind: A1
- Application number: 16/208,602
- Filed: 2018-12-04
- Published: 2019-06-06
- Earliest claimed: 2017-12-05
- Assignees: myFavorEats Ltd.
- Applicants: myFavorEats Ltd.
- Inventors: Orly RAPAPORT
- Web page: https://patentgrep.com/patent/US20190171707A1

## CPC

- G06F 40/205: Parsing
- G06F 3/04812: Interaction techniques based on cursor appearance or behaviour, e.g. being affected by the presence of displayed objects
- G06F 3/0482: Interaction with lists of selectable items, e.g. menus
- G06F 16/3329: Natural language query formulation
- G06F 16/337: {Profile generation, learning or modification}
- G06F 16/951: Indexing; Web crawling techniques
- G06F 40/151: Transformation
- G06F 40/279: Recognition of textual entities
- G06N 3/0499: Feedforward networks
- G06N 3/084: Backpropagation, e.g. using gradient descent
- G06N 3/09: Supervised learning
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS

## Abstract

There is provided a method of computing an ingredient substitute(s), comprising: receiving a target food-recipe data structure, receiving a selection of ingredient(s) for substitution, accessing ingredient substitution data structure(s) each storing substitutes for one of the selected ingredient(s), computing adjusted food-recipe data structure(s) that include a predefined textual code that replaces one of the selected ingredients for substitution, computing for each of the adjusted food-recipe data structures, by a trained neural network, coordinates of a respective adjusted point within a multi-dimensional space, determining, for each of the adjusted food-recipe data structures, the value of the respective coordinates corresponding to each one of the substitute ingredient(s) corresponding to the selected ingredient for substitution, selecting, for each of the selected ingredients for substitution, substitute ingredient indication(s) from the corresponding ingredient substitution data structure according to a requirement of the value of the coordinate, and presenting the selected substitute ingredient indication(s).

## Claims

### Claim 1

A method of computing by a computer system in communication with an ingredient-substitution dataset, with a trained neural network, and with a client terminal, via a network, a substitute for at least one ingredient in a text-based food-recipe, comprising:
receiving a target text-based food-recipe including a set of text-based instructions for preparation of a certain food-recipe according to a set of text-based ingredients;
converting the target text-based food-recipe to a target food-recipe data structure storing an indication of the set of text-based ingredients, and the set of text-based instructions;
receiving from the client terminal via a GUI presenting the target text-based food-recipe on a display, a selection of at least one text-based ingredient of the set of text-based ingredients for substitution;
accessing at least one ingredient substitution data structure each storing at least one ingredient indication that is a substitutes for one of the selected at least one text-based ingredient;
computing at least one adjusted food-recipe data structure for the target food-recipe data structure, each adjusted food-recipe data structure includes a predefined textual code that replaces one of the selected text-based ingredients for substitution;
computing for each of the adjusted food-recipe data structures, by the trained neural network, coordinates of a respective adjusted point within a multi-dimensional food-recipe space;
determining, for each of the adjusted food-recipe data structures, the value of the coordinates of the respective adjusted point within the multi-dimensional food-recipe space corresponding to each one of the substitute ingredient indications of the ingredient substitution data structure corresponding to the selected text-based ingredient for substitution;
selecting, for each of the selected text-based ingredients for substitution, at least one substitute ingredient indication from the corresponding ingredient substitution data structure according to a requirement of the value of the coordinate; and
presenting within the GUI on the display of the client terminal in association with the text-based target food-recipe, for each of the selected text-based ingredients for substitution, the selected at least one substitute ingredient indication.

### Claim 2 (depends on 1)

The method according to claim 1, further comprising:
receiving from the client terminal via a GUI presenting the target text-based food-recipe on a display, at least one parameter of a personal user profile, wherein each parameter of the personal user profile is associated with at least one ingredient indication,
wherein the selection of at least one text-based ingredient of the set of text-based ingredients for substitution is performed according to the indication of ingredients that satisfy the personal user profile.

### Claim 3 (depends on 2)

The method according to claim 2, wherein one or more parameters of the user profile are selected from the group comprising: ingredients disliked, ingredients preferred, allergies, dairy free, genetically engineered free, organic, low carb, Eatwell Apple, contains nuts, vegetarian, Kosher, gluten free, sugar free, vegan, Halal, and combinations of the aforementioned.

### Claim 4 (depends on 1)

The method according to claim 1, wherein the at least one ingredient of the set of ingredients of the target food-recipe data structure is selected for substitution by at least one of clicking with a pointer, hovering a pointer over the at least one text-based ingredient, and clicking an icon associated with the at least one text-based ingredient.

### Claim 5 (depends on 1)

The method according to claim 1, and wherein the selected at least one text-based ingredient for substitution is automatically substituted within the GUI with the selected at least one substitute ingredient indication.

### Claim 6 (depends on 1)

The method according to claim 1, wherein the requirement comprises selecting a predefined number of substitute ingredient indications according to the highest coordinate values and above a preselected floor-value.

### Claim 7 (depends on 1)

The method according to claim 1, wherein the text-based food-recipe is converted into the food-recipe data structure by parsing and formatting the text-based food-recipe, wherein the text-based set of ingredient indications are stored according to predefined identifiers, each ingredient indication of the set of ingredient indications is stored by the food-recipe data structure in association with a respective quantity of the respective ingredient of the respective text-based food-recipe, and the text-based instructions are stored as simple text.

### Claim 8 (depends on 1)

The method according to claim 1, wherein values of parameters of each ingredient indication define corresponding values of the coordinates along each of a plurality of axes of a multi-dimensional ingredient space, the parameters include at least one of: a plurality of nutritional parameters, at least one botanical parameter, and a plurality of chemical parameters.

### Claim 9 (depends on 8)

The method according to claim 8, wherein the plurality of nutritional parameters are selected from the group comprising: carbohydrate content, sugar content, saturated fat content, fiber content, omega-3 content, and alcohol content, wherein the at least one botanical parameter is selected from the group comprising: fruit, vegetable, nut, and animal part, and the plurality of chemical parameters are selected from the group comprising: texture, comparable taste, and comparable smell.

### Claim 10 (depends on 1)

The method according to claim 1, wherein the coordinates of the adjusted point within the multi-dimensional food-recipe space is computed according to values of weights of at least one hidden layer within the neural network, obtained by forward-feeding the food-recipe data structure into the trained neural network.

### Claim 11 (depends on 1)

The method according to claim 1, further comprising encoding the target text-based food-recipe for converting into the target food-recipe data structure for feeding into an input layer of the neural network, the encoded converted target food-recipe data structure include at least one of:
(i) a vector representation of a plurality of ingredients appearing in the target text-based food-recipe identified within the ingredient dataset,
(ii) a vector of quantity for each of the plurality of ingredients appearing in the target text-based food-recipe,
(iii) a weighted average of vectors of values of a plurality of parameters of each ingredient appearing in the target text-based food-recipe, and
(iv) a vector representation of the text-based instructions of the target text-based food-recipe, and
(v) a vector representation of the text-based title of the target text-based food-recipe.

### Claim 12 (depends on 11)

The method according to claim 11, wherein:
(i) the vector representation of the plurality of ingredients is represented within a multi-dimensional ingredient space, wherein each axes of the multi-dimensional ingredient space corresponds to one ingredient stored in the ingredient dataset, and a value along each axes denotes the presence or absence of the corresponding ingredient in the target text-based food-recipe,
(ii) the vector of quantity for each of the plurality of ingredients is represented by a value along an axis indicative of quantity of each respective ingredient in the target text-based food-recipe,
(iii) the values of the plural of parameters are indicative of coordinates along each of a plurality of axes of a multi-dimensional ingredient space, each axis denoting one parameter of the plurality of parameters,
(iv) the vector representation of the text-based instructions is computed according to at least one of: a bag-of-words representation computed based on term frequency-inverse document frequency (tf-idf), and a latent semantic sentence representation encoded by standard language based neural network output, and
(v) the vector representation of the text-based title is computed according to at least one of: a bag-of-words representation computed based on term frequency-inverse document frequency (tf-idf), and a latent semantic sentence representation encoded by standard language based neural network output.

### Claim 13

A method of identifying at least one similar recipe for a text-based food-recipe by a computer system in communication with a trained neural network, with a food-recipe dataset, and with a client terminal, via a network, comprising:
receiving from the client terminal via a GUI, a target text-based food-recipe including a text-based set of instructions for preparation of a certain food-recipe according to a text-based set of ingredients;
converting the target text-based food-recipe to a target food-recipe data structure storing an indication of the set of ingredients, and the text-based instructions;
receiving a plurality of sample food-recipe data structures each storing a set of ingredient indications, and text-based instructions for preparation;
computing for the target food-recipe data structure, by the trained neural network, coordinates of a target point within a multi-dimensional food-recipe space;
computing for each of the sample food-recipe data structures, by the trained neural network, coordinates of a respective sample point within the multi-dimensional food-recipe space;
computing a statistical distance between the target point and each respective sample point;
selecting at least one sample food-recipe data structure according to a requirement of the statistical distance; and
providing a text-based version of the selected at least one sample food-recipe data structure for presentation within the GUI presented on the display of the client terminal.

### Claim 14 (depends on 13)

The method according to claim 13, further comprising:
receiving from the client terminal via the GUI, a selection of at least one ingredient for substitution appearing within the set of ingredients of the target food-recipe data structure;
receiving by the computer system in communication with an ingredient-substitution dataset, a plurality of ingredient substitution data structures each corresponding to one of the selected at least one ingredient, each ingredient substitution data structure storing at least two ingredients that are substitutes for each other;
identifying, within the selected at least one sample food-recipe data structure, at least one certain ingredient stored in the ingredient substitution data structure storing one of the selected ingredients; and
providing an indication of substitution of the selected at least one ingredient with the at least one certain ingredient, for the target food-recipe data structure.

### Claim 15 (depends on 13)

The method according to claim 13, wherein the requirement of the statistical distance is a preselected value indicative of a minimum similarity between the target food-recipe and each of the selected sample food-recipes.

### Claim 16 (depends on 13)

The method according to claim 13, wherein the coordinates are based on weights of hidden layers of the trained neural network.

### Claim 17 (depends on 13)

The method according to claim 13, further comprising:
receiving at least one similarity parameter, wherein the requirement of the statistical distance is based on the similarity parameter, wherein axes of the multi-dimensional food-recipe space corresponding to the at least one similarity parameter are assigned weights significantly higher than other axes, such that at least one sample food-recipe data structure is selected according to the shortest statistical distance between the target point and respective sample points along the axes of the at least one similarity parameter.

### Claim 18 (depends on 17)

The method according to claim 17, wherein the at least one similarity parameter includes at least one of: taste, and texture.

### Claim 19

A method of computing a classifier for classification of a text-based food-recipe by a computer system in communication with a trained neural network, and a food-recipe dataset, comprising:
receiving a plurality of sample food-recipe data structures each storing a set of ingredient indications, and text-based instructions for preparation;
computing for each of the sample food-recipe data structures, by the trained neural network, coordinates of a respective sample point within a multi-dimensional food-recipe space;
receiving an indication of a classification type for each of the plurality of sample food-recipe data structures; and
training a statistical classifier for computing a target classification type for a target food-recipe data structure according to the sample points and associated classification types.

### Claim 20 (depends on 19)

The method according to claim 19, further comprising:
receiving a plurality of ingredient substitution data structures stored in an ingredient substitution dataset, each corresponding to one of the set of ingredients, each ingredient substitution data structure storing at least two ingredients that are substitutes for each other;
for each at least one sample food-recipe data structure:
receiving a selection of at least one ingredient for substitution appearing within the set of ingredients of the target food-recipe data structure;
receiving the indication of the classification type including a score indicative of appropriateness of substituting the selected at least one ingredient with at least one certain ingredient stored in the ingredient substitution data structure storing one of the selected ingredients;
wherein the statistical classifier is trained for computing an appropriateness score for substituting a target ingredient with another ingredient for the target food-recipe data structure according to the sample points, score indicative of appropriateness of substitution, the selected at least one ingredient, and the at least one certain ingredient.

### Claim 21 (depends on 20)

The method according to claim 20, wherein the classification type is selected from the group comprising: type of ethnic food, country of origin of the food, quick to prepare food, gourmet food, and categorical name of the food.

### Claim 22

A computer implemented method of generating a neural network for computation of a multi-dimensional representation of a text-based food-recipe, comprising:
receiving by a computer system in communication with: a food-recipe dataset, an ingredient dataset, and an ingredient-substitution dataset:
a plurality of food-recipe data structures each storing a set of ingredient indications and text of instructions for preparation,
a plurality of ingredient data structures each storing values of parameters of a respective ingredient indication of the set of ingredient indications, represented as an ingredient point in a multi-dimensional ingredient space,
a plurality of ingredient substitution data structures each storing at least two indications of ingredients stored by the ingredient dataset that are substitutes for at least one ingredient indication stored in at least one food-recipe data structure, and
training a neural network according to the plurality of food-recipe data structures, the plurality of ingredient data structures, and the plurality of ingredient substitution data structures, wherein initial network weights of the neural network are randomly selected and adjusted according to a plurality of iterations, and comprising for each iteration:
randomly selecting a certain food-recipe data structure,
creating an adjusted food-recipe data-structure from the certain food-recipe data-structure by replacing a randomly selected certain ingredient indication with a predefined keyword in the set of ingredients and in the instructions of the certain food-recipe,
feeding the adjusted food-recipe data-structure into the current neural network, and computing an objective loss function indicative of a statistical distance between a set of coordinates of the adjusted food-recipe data structure denoting an adjusted point within a multi-dimensional food-recipe space, and a set of coordinates of the certain food-recipe data-structure denoting a certain food-recipe point within the multi-dimensional food-recipe space;
wherein the neural network is trained by computation of a set of weights for layers of the neural network according to iterative minimization of the objective loss function until a stop condition is met;
wherein the trained neural network computes coordinates of a food-recipe point within a multi-dimensional food-recipe space for an input of a target text-based food-recipe received by the computer system from a client terminal over a network.

### Claim 23 (depends on 22)

The method according to claim 22, wherein an input layer of the trained neural network is followed by at least one hidden layer, wherein each at least one hidden layer is of a dimension determined by a predefined parameter, each at least one hidden layer is connected to adjacent layers by full connectivity, wherein a variable weight is assigned on the connection of each coordinate in each certain hidden layer, to each coordinate in the layer above and the layer below each certain layer, wherein a top hidden layer is connected to an output layer, wherein the output layer includes a single coordinate for each possible ingredient stored by the ingredient dataset, wherein the output layer is connected to the topmost hidden layer by full connectivity.

### Claim 24 (depends on 22)

The method according to claim 22, wherein at least one of the plurality of ingredient-substitution data structures is computed based on an analysis of data collected by crawling code that automatically crawls food-based content stored on network connected nodes.

### Claim 25 (depends on 22)

The method according to claim 22, wherein the neural network is trained based on stochastic gradient descent on a distribution of a randomly selected plurality of food-recipe data structures from the food-recipe dataset.
