Git Product home page Git Product logo

food2vec's Introduction

food2vec

Food vectors. Live demo at https://altosaar.github.io/food2vec/, blog post with more information and pretty plots here: https://jaan.io/food2vec-augmented-cooking-machine-intelligence/

Data

Get the data and preprocess it:

cd dat
./download_data.sh
# get kaggle data from https://www.kaggle.com/c/whats-cooking/
python preprocess_kaggle_data.py
./preprocess_data.sh

Usage

Train a model on the recipes dataset:

git clone [email protected]:altosaar/food2vec.git
cd food2vec
git submodule update --init
cd src/sentence_word2vec
git submodule update --init
./compile_ops.sh
# run word2vec with the recipes as context
python word2vec_optimized.py --train_data ../../dat/recipes --interactive --save_path /tmp --subsample 0 --eval 0 --interactive --embedding_size 100

Visualization & embedding exploration tools

# make the t-SNE plot
cd ../../
# run t-sne and make the plots for the ingredient embeddings
jupyter notebook ./src/plot_ingredients_recipes.ipynb
# view the analogy tool on a browser
open index.html

Embedding plot.ly plots to host them yourself

https://gist.github.com/altosaar/67d8456ad28acd1abb497f1950d8de8a

Contributing

Pull requests and all feedback welcome! Please file an issue if you run into problems replicating the results.

TODOs:

Acknowledgments

Thanks to Anthony for open-sourcing a javascript embedding browser -- the one here is heavily based on it.

food2vec's People

Contributors

jaanli avatar

Watchers

Yang avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.