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.
Thanks in advance!
I'm posting my temporary solutionwhich may help others solve similar problems and I think this is pretty basic, but works nice:
- import all data to database (postgres in my case), where Recipe table has only name and Ingredient table has name and ForeignKey to recipe
- once user inputs recipe name (
rname), I run query using postgres' Trigram Similarity module to detect similarity between
rnameand recipe table names. Then I filter out recipes which similarity is greater than .1 (for example)
- 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
- Finally, I return ingredients (10 mostly used ones)
I think, looking through proposed solutions and also posting them.