Skip to content

Code & data for the KDD 2020 paper "Reciptor: An Effective Pretrained Model for Recipe Representation Learning"

Notifications You must be signed in to change notification settings

zakimjz/Reciptor

 
 

Repository files navigation

Reciptor

This repository contains the code to train and evaluate models from the paper:
Reciptor: An Effective Pretrained Model for Recipe Representation Learning.

Requirements

pip install -r requirements.txt

Data

Data preparation

To prepare training data from scratch, run:

python prepare_dataset.py

Please make sure you have downloaded

  • data/encs_train_1024.t7: Skip-instructions train partition
  • data/encs_val_1024.t7: Skip-instructions val partition
  • data/encs_test_1024.t7: Skip-instructions test partition

from the original recipe1M and put them under their corresponding folders and downloaded

Download preprocessed data

Alternatively, you can download our preprocessed sample data from reciptor_data and the full data from zenodo.

Model

To run the recipe representation model:

bash run_foodcom_reciptor.sh

The model will be saved in --snapshots path.

  • Notice: to run the baseline models (jm, sjm) described in our paper, please change --model_type to jm|sjm accordingly.

To store the pretrained recipe embeddings:

bash run_store_embed.sh

Evaluation

To evaluate the pretrained recipe embeddings on category classification task:

bash run_evaluation.sh

Credit

The backbone of this framework is based on torralba-lab/im2recipe-Pytorch

The implementation of Set Transformer is based on TropComplique/set-transformer.

Reference

About

Code & data for the KDD 2020 paper "Reciptor: An Effective Pretrained Model for Recipe Representation Learning"

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • Python 98.8%
  • Shell 1.2%