Tag that Recipe

Tushar Mittal

Tushar Mittal

Kanpur, Uttar Pradesh

0 0
  • 0 Collaborators

Using NLP to predict tags for a recipe given its name, ingredients, cooking instructions and time. ...learn more

Project status: Under Development

Artificial Intelligence

Intel Technologies
Intel Opt ML/DL Framework, Intel Python

Code Samples [1]

Overview / Usage

The project aims to predict tags relevant to a recipe given its name, ingredients, cooking instructions and time. This automatic tag generation can be useful for the websites publishing cooking recipes to suggest tags to the users. These tags can then further be used to improve the search results on the website.

Methodology / Approach

I had this dataset which contained information about 80k recipes with their name, ingredients, cooking instructions, cooking time and the tags related to it. The process for predicting the tags mainly consisted of the following steps:

  • The dataset was very unclean, so I started by EDA and cleaning the dataset.
  • I split up the tags and stored them into arrays and also stored how many tags were present for each recipe.
  • I then cleaned the rest of the columns, the same process was followed for all features
    • Removing everything except alphabets and spaces
    • Removing stopwords and custom words (representing quantity)
    • Removing words with length 1 or 2
    • Storing the lemmas of all words
  • Then I combined recipe\_name, ingredients and cooking method into a single column named full\_recipe and also stores each recipe character length.
  • Then I converted tags to binary arrays.
  • I tokenized all the words in the full\_recipe, converted full\_recipe into fixed length sequence of 800 chars and used the GloVe embeddings to converted words into vectors.
  • On those embeddings and tags I trained a neural network with 1D conv and Dense layers.

Technologies Used

**Data Handling and Cleaning: **Pandas, Numpy, NLTK

Visualization: Matplotlib

Training: Scikit Learn, Tensorflow

Repository

https://colab.research.google.com/drive/18xfUwy9BhaSrbK0IYfo8ar6Yhihb6UjH

Comments (0)