Coder Social home page Coder Social logo

recipe-recommendation-system's Introduction

Recipe Recommendation System ๐Ÿ” ๐Ÿ•

Overview

Home cooks everywhere are always look for inspiration for new dishes to make. Searching through google helps, but google search queries return better results for just food categories (e.g. italian, japanese, baking, sauces, etc.). This recipe recommendation system intends to refine the recipe search process by allowing users to search recipes based on specific ingredients that they have or intend to use. The primary advantage for this search method is the ability to find recipes that incorporate disparate or unlikely ingredient pairings, allowing adventurous home cooks to find the cooking inspiration they otherwise couldn't find.

Project Data

Data was pulled from github account rtlee9 who prescraped data from Allrecipes.com, Foodnetwork.com, and Epicurious.com. ~12500 recipes are included, including the title, ingredients, and instructions for each recipe.

Goals:

  1. Perform unsupervised Topic Modeling on the recipes to group recipes into categories. Then perform TextRank on the generated topics to produce keyword summarizations that can stand in as category names for each topic.
  2. Create a search algorithm that utilizes similarity scoring to rank recipes according to the greatest similarity to the search query.

Data Model Flow Chart

The general flow of data is visually summarized above. Starting with the raw recipe data, the recipes are cleaned, parsed, and TF-IDF vectorized by recipe. Using this vectorization, NMF topic modelling arbitrarily generates 50 topics. TextRank then pulls 25 keywords from each topic, and these keywords are appended to the top 2000 recipes in each topic. Recipe titles, ingredients, keywords, and instructions are then TF-IDF transformed along with an ingredients list, then a query similarity score is generated for each recipe and the recipes are returned based on similarity rank.

Data Features:

  • Recipe Title
  • Recipe Ingredients
  • Recipe Instructions
  • Recipe Keywords (Generated from Topic Modeling and Textrank)

Model Features:

  • Search based on ingredients list (e.g. [ingredient 1, ingredient 2, ingredient 3]).
  • Option to rank ingredients in order of ingredients. i.e. each successive ingredient in list is weighted incrementally less in the search query.
  • Generated topic keywords for a select number of recipes helps refine recipe results.

Search Performance and Detailed Parameter Selection

For more detailed analysis of the search performance please reference the presentation slides and ipython notebook included in the repo. Included in the presentation slides are the various model parameters and the model tuning and evaluation process.

Summary of Conclusions

While this search algorithm works quite well, it unfortuantely underutilizes the generated keywords produced using topic modelling and TextRank. The search engine penalizes recipes without any appended keywords and the tuning process neglects to include around 10,000 recipes from receiving keywords. Also, because dense word embeddings were not used, it is required for keywords to be included in the search query for there to be any similarity to the keywords at all; a better model would to generate keywords using dense word embeddings so that search query ingredients can load similarity scores based on a semantic similarity.

That being said, the cosine similarity scoring does return intriguing and useful recipes that fit the original purpose of the search algorithm. Different ingredients can be paired to find interesting and tasty recipes that one wouldn't normally encounter.

recipe-recommendation-system's People

Contributors

johnvillanueva avatar

Stargazers

Prudvi Kuamar Reddy NS avatar HuynhLeDacTai avatar Erwin Mongui avatar Ashad  avatar Maanasa S avatar  avatar Ali Arslanhan avatar Samuel Ji avatar Md Ataullha avatar  avatar Adi Gulalkari avatar Tulyawat Tubkhong avatar Oralita avatar  avatar Ermolay Romanov avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.