# suggest ingredients based on recipe title [closed]

I would like to construct system that would suggest user ingredients once he/she inputs title of the recipe.

I think that this is the task of machine learning or AI, but on the other hand I am pretty new to ML and generally in AI development and I feel kinda lost, since I don't know where to start and with what to start.

So far, I've managed to crawl data from web page with recipe title and ingredients which are used for this recipes.

My thoughts are that, this problem may be solved with suggester system, but on the other hand I think classification / clustering algorithms may be used to divide recipes in clusters / categories and once input title is associated to cluster ingredients may be generated from that cluster, but I don't know which is best solution and I wonder if there may be other ones.

### I'm posting my temporary solution

which may help others solve similar problems and I think this is pretty basic, but works nice:

1. import all data to database (postgres in my case), where Recipe table has only name and Ingredient table has name and ForeignKey to recipe
2. once user inputs recipe name (rname), I run query using postgres' Trigram Similarity module to detect similarity between rname and recipe table names. Then I filter out recipes which similarity is greater than .1 (for example)
3. After that, I get all ingredients which are linked to filtered recipes, annotate ingredient usage for individual ingredient (calculate ingredient usage ratio). And order by usage ratio DESC
4. Finally, I return ingredients (10 mostly used ones)

I think, looking through proposed solutions and also posting them.

• You could try to investigate the Google Assistant and its related APIs – knb Jun 4 '18 at 10:14
• This task is called food/ingredient pairing; cf. e.g., Flavor network and the principles of food pairing – Emre Jun 5 '18 at 17:28