Tag that Recipe
- 0 Collaborators
Using NLP to predict tags for a recipe given its name, ingredients, cooking instructions and time. ...learn more
Project status: Under Development
Intel Technologies
Intel Opt ML/DL Framework,
Intel Python
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
andcooking method
into a single column namedfull\_recipe
and also stores each recipe character length. - Then I converted tags to binary arrays.
- I tokenized all the words in the
full\_recipe
, convertedfull\_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