Inspiration

As the pandemic continues, we are spending more and more time at home - and we all must ponder the same question three times a day: "What should I make for my next meal?" Tired of coming up with different recipes using what's available in the fridge, we developed our own recipe recommender - named "Discrete Lettuce" - that does the thinking for you!

What it does

Our recipe recommender helps people find recipes that use up as many of their leftover ingredients as possible. Users simply input some of the food items they would like to use up, and our web application finds recipes from a collection of over 3,000 recipes for them to try out! In addition, our users can also select the kind of mood they want to experience while cooking, and Discrete Lettuce can take that choice into account!

How we built it

Discrete Lettuce is a web-based recipe recommender that combines simple yet powerful natural language processing techniques with deep learning. Our data set was graciously provided by Kaggle (CC0 license,) and our team specifically used a pretrained t5-base-finetuned-emotion model from mrm8488 (via HuggingFace 🤗) for analyzing the sentiments of each recipe. The preprocessing of our dataset was mainly done using pandas and HuggingFace Transformers on Kaggle Notebooks, Google Colaboratory, and in VSCode over SSH.

We leveraged Google Cloud Platform (GCP) Cloud TPUs and TPU VMs to analyze the sentiment of over 400,000 recipes in our dataset in less than two hours. The tremendous DL processing power of GCP TPUs enabled us to bake the function of recommending recipes based on the user's mood into our project within the short period of the Hackathon.

The front end of Discrete Lettuce is a simple display created with React.js, CSS, SCSS, and Material-UI - it also uses McHacks 9 colours to make the display fit the theme of this year's hackathon! Thanks to the TPU-powered preprocessing on the GCP, we managed to keep Discrete Lettuce purely client-side and thus delightfully responsive. A demo of this application is hosted on Github Pages (using gh-pages and additional code from rafgraph).

Challenges we ran into

A few of the challenges we encountered as a team was learning new technologies to process the raw data we obtained from Kaggle and connecting the front end of the application to the back end. As people new to many of the technologies we were using, we relied heavily on documentation and mentorship to help solve our roadblocks which took a lot of time away from actually developing our project. In addition, the process of building the back end and the front end occurred at the same time, so there were many struggles in connecting the two as the endpoints were not yet set up to be accessed when needed by the front end and the styling of the front end frequently needed modification to better display information from the back end that was added later on.

Accomplishments that we're proud of

This is the first hackathon most of our team members have ever attended, and, as such, the experience of having developed a project was extremely rewarding! The process of brainstorming and bringing our ideas to fruition was a challenge that we all really appreciated. This project also took a lot of patience, learning, and flexibility from all of us, and it was a truly humbling experience as aspiring innovators - we all have so much more to learn!

What we learned

  1. There are so many different packages and tools and technologies that we never knew about (NLTK Lemmatization, literal_eval, the ast module, Flask, Streamlit, HuggingFace Transformers, just to name a few we considered and used for our project).
  2. There exists a very blessed VSCode extension by the name of LiveShare that makes developing simultaneously much easier.
  3. There exists another wonderful tool by the name of Balsamiq that allows developers to discuss and plan UI designs.
  4. There are a lot of datasets out there! But finding a good one is rather challenging...
  5. It takes a ridiculous number of Javascript files to build a simple web application.
  6. It takes roughly four hackers to build one recipe recommender in 36 hours. (This one is an educated guess.)

What's next for Discrete Lettuce

There is so much more we can do to expand Discrete Lettuce! For starters, we would love to implement additional features such as filters for vegan or vegetarian foods, the option to specify which ingredients to exclude for our users with allergies or strong personal preferences, and a spice-meter that allows users to set their spice tolerance and thus only be recommended recipes that are below their threshold. We certainly also need some good code clean-up and more documentations.

In the future, we would like to build on Discrete Lettuce's keyword matching method by using word embedding to overcome the matching difficulty of synonymous yet different expressions (it's kind of hard to tell apart potato vs potatoes vs waxy potatoes vs starchy potatoes, etc in our current recommender). We are excited about how modern AI frameworks and accelerators such as GCP TPUs could help us bring Discrete Lettuce even further!

Built With

+ 3 more
Share this project:

Updates