Project for CS329s: Machine Learning System Design
https://stanford-cs329s.github.io/reports/tender-recipe-recommendations/
Run pip install -r requirements.txt to install python dependencies
Raw data is scraped by running the scrape_recipes.ipynb notebook in order to scrape Asian websites for around 5 websites
-
cd feature_generation -
Run
python save_recipes.pyin order to save theclean_data/all_recipes_nutrient.csvandclean_data/url_index_mapping.csvcsv files -
Run
python save_images.pyin order save the image files from the scraped websites locally to theimagesdirectory. -
Run
python center_crop_resize_images.pyin order to resize and center crop all images to 200 by 200 to theimages_resizeddirectory so that thumbnails are all standardized -
Run
python get_embeddings.pyin order to save the embeddings needed to run recommendation algorithms. This saves 4 files:clean_data/{folder}/nutrient_features.csv,clean_data/{folder}ing_features.csv,clean_data/{folder}embeddings_features_mvp.csv, andclean_data/embeddings_mvp_scaled.csv, where the embeddings scaled is used for recipe similarity and the other csv's are intermediate.
-- Folder represents ['mains', 'desserts', 'sides']
- Run
python label_recipes.pyto get the keyword labels for our recipes
-
serve_recs.pycontains relevant API class for grabbing urls and images in order to serve and sample recipes for application -
streamlit run ucb_rex.pyfor ucb algorithm app locally