Code Monkey home page Code Monkey logo

parseingredient's Introduction

README

  1. Generate JSON data for each recipe. Data will be in finished

cd src && python3 parseHTML.py /location/to/data

  1. Tag recipes. Make sure to have ingredientTagging setup in another directory (see source)

cd src && python3 ingredientTagging.py

  1. Generate the models and then generate the markov files

cd src && python3 markovRecipe.py

Todo

  • Recipe extractors
  • Ingredient parser (using NYTimes phrase-tagger)
  • Unit converter

Unit converter notes

Give the parsed recipe,

{
  "quantity":"1.5",
  "measurement":"cups",
  "ingredient":"green pepper",
  "sr28":"1239810"
}

it will make the conversion to grams:

{
  "quantity":"300",
  "measurement":"gram",
  "ingredient":"green pepper",
  "sr28":"1239810"
}

How to do this?

  1. Look up ingredient in sr28. If found, and the weight associated with it is the same as the current weight, use that conversion, if not make a conversion to a weight associated with the sr28.

  2. (optional) To convert the measurement, use an array of increasing measurement types:

[milliliter, teaspoon, tablespoon, ounce, cup, pint, quart, gallon, liter]

and the associated transformation array (left to right):

[4, 3, 2, 8, 2, 2, 4, 0.2642].

For example, 4 millilter = 1 teaspoon and 0.26452 gallon = 1 liter. Any conversion can be made by simply traversing the array.

  1. Use the sr28 weight to convert to grams.

Data

data/FoodPricesDatabase0304.tab from here which contains prices per 100 g.

data/sr28/* are from the sr28 USDA database. Documentation is available.

Relevant

http://opensourcecook.com/recipes-copyright-law https://news.ycombinator.com/item?id=11711467

parseingredient's People

Contributors

schollz avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

dmonizer

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.