Skip to content

EmilyCheoh/Project2_Recipe

Repository files navigation

Project 2: Recipe Transformer

Usage:

  1. Run the command: python -m spacy download en_core_web_md
  2. To run the program: python main.py

To/From Vegetarian:

Eggs and dairy products are allowed in vegetarian recipes. Meats and seafoods are removed.

To/From Healthy:

Our definintion of eating healthy: less sugar, cheese, salt, and oil, more vegetables, less meat, no frying. Basically, we remove any sugar, cheese from our ingredients, set less quantity in meat, salt, and oil, and add more quantity of vegetables in to our ingredients. Also, no "fry" is allowed in our cooking methods.

To French/Italian Cuisine:

Important methods for this transformation are contained in french.py and italian.py. This transformation is done by categorizing the ingredients into several predetermined categories (e.g. meat, vegetables). This categorization is done using vectors (using spaCy), marking the distance between each ingredient and the category title (or similar words, like "spice" for "seasoning"). There is a hardcoded set of typically French/Italian ingredients stored and categorized. (There are some empty categories, indicating common food types of which French/Italian cuisine does not have specific varieties, but which would be bad to misclassify - e.g. pasta for French). Each original ingredient is compared to other ingredients of its category, and if there is a close enough match, it is replaced by the French/Italian version. The ingredients are replaced in the ingredient listings and also in the steps.

Double/Halve Amount:

Simply doubling quantity of ingredients or cutting it by half.

Example Output:

Please enter a URL from AllRecipes.com:
https://www.allrecipes.com/recipe/218091/classic-and-simple-meat-lasagna/
-------Ingredients-----
12 whole wheat, lasagna noodles
..........
name: whole wheat, lasagna noodles
quantity: 12
measurement:
preparation:

1 pound lean ground beef
..........
name: lean ground beef
quantity: 1
measurement: pound
preparation:

2 cloves garlic chopped
..........
name: garlic
quantity: 2
measurement: cloves
preparation: chopped

1/2 teaspoon garlic powder
..........
name: garlic powder
quantity: 1/2
measurement: teaspoon
preparation:

1 teaspoon dried oregano or to taste
..........
name: dried oregano
quantity: 1
measurement: teaspoon
preparation: or to taste

salt and ground black pepper to taste
..........
name: salt and ground black pepper to taste
quantity:
measurement:
preparation:

1 (16 ounce) package cottage cheese
..........
name: cottage cheese
quantity: 1 (16 ounce)
measurement: package
preparation:

2 eggs
..........
name: eggs
quantity: 2
measurement:
preparation:

1/2 cup shredded parmesan cheese
..........
name: shredded parmesan cheese
quantity: 1/2
measurement: cup
preparation:

1 1/2 (25 ounce) jars tomato-basil pasta sauce
..........
name: tomato-basil pasta sauce
quantity: 1 1/2 (25 ounce)
measurement: jars
preparation:

2 cups shredded mozzarella cheese
..........
name: shredded mozzarella cheese
quantity: 2
measurement: cups
preparation:

-------Tools-----
oven
pot
plate
skillet
bowl
pan
foil

-------Methods-----
preheat
boil
cook
uncovered
stirring
remove
chopping
drain
mix
combined
baking
top
sprinkle
brown
stand

-------Steps------
step 1
Preheat oven to 350 degrees F (175 degrees C)
..........
cooking tools: oven
cooking methods: preheat

step 2
Fill a large pot with lightly salted water and bring to a rolling boil over high heat
..........
ingredients: whole wheat, lasagna noodles
cooking tools: pot
cooking methods: boil, heat

step 3
Once the water is boiling, add the lasagna noodles a few at a time, and return to a boil
..........
ingredients: whole wheat, lasagna noodles
cooking methods: boiling

step 4
Cook the pasta uncovered, stirring occasionally, until the pasta has cooked through, but is still firm to the bite, about 10 minutes
..........
ingredients: tomato-basil pasta sauce, whole wheat, lasagna noodles
cooking methods: cook, uncovered, stirring cooking time: 10 minutes

step 5
Remove the noodles to a plate
..........
ingredients: whole wheat, lasagna noodles
cooking tools: plate
cooking methods: remove

step 6
Place the ground beef into a skillet over medium heat, add the garlic, garlic powder, oregano, salt, and black pepper to the skillet
..........
ingredients: lean ground beef, whole wheat, lasagna noodles, garlic, garlic powder, dried oregano, salt and ground black pepper to taste
cooking tools: skillet
cooking methods: heat

step 7
Cook the meat, chopping it into small chunks as it cooks, until no longer pink, about 10 minutes
..........
ingredients: whole wheat, lasagna noodles
cooking methods: cook, chopping
cooking time: 10 minutes

step 8
Drain excess grease
..........
cooking methods: drain

step 9
In a bowl, mix the cottage cheese, eggs, and Parmesan cheese until thoroughly combined
..........
ingredients: whole wheat, lasagna noodles, cottage cheese, eggs
cooking tools: bowl
cooking methods: mix, combined

step 10
Place 4 noodles side by side into the bottom of a 9x13-inch baking pan
..........
ingredients: whole wheat, lasagna noodles
cooking tools: pan
cooking methods: baking

step 11
top with a layer of the tomato-basil sauce, a layer of ground beef mixture, and a layer of the cottage cheese mixture
..........
ingredients: tomato-basil pasta sauce, whole wheat, lasagna noodles, lean ground beef, cottage cheese
cooking methods: top, mixture

step 12
Repeat layers twice more, ending with a layer of sauce
..........
ingredients: whole wheat, lasagna noodles, tomato-basil pasta sauce

step 13
sprinkle top with the mozzarella cheese
..........
ingredients: shredded mozzarella cheese, cottage cheese
cooking methods: sprinkle, top

step 14
Cover the dish with aluminum foil
..........
cooking tools: foil
cooking methods: cover

step 15
Bake in the preheated oven until the casserole is bubbling and the cheese has melted, about 30 minutes
..........
ingredients: cottage cheese, whole wheat, lasagna noodles
cooking tools: oven
cooking methods: bake, preheated
cooking time: 30 minutes

step 16
Remove foil and bake until cheese has begun to brown, about 10 more minutes
..........
ingredients: cottage cheese, whole wheat, lasagna noodles
cooking tools: foil
cooking methods: remove, bake, brown
cooking time: 10 minutes

step 17
Allow to stand at least 10 minutes before serving
..........
cooking methods: stand
cooking time: 10 minutes

Transformation List:

  1. To Vegetarian/to Non-Vegetarian
  2. To healthy/ To unhealthy
  3. to French/Italian Style of cuisine
  4. Double the amount or cut it by half

Please select your transformation: 1

Press 1 to transform to Vegetarian
Press 2 to transform to Non-Vegetarian

Please select your transformation: 1

Transforming from Non-Vegetarian to Vegetarian...

-------------------------

Replaced lean ground beef with tofu.

-------Ingredients-----
12 whole wheat, lasagna noodles
..........
ingredient name: whole wheat, lasagna noodles
quantity: 12
measurement:
preparation:

1 pound tofu
..........
ingredient name: tofu
quantity: 1
measurement: pound
preparation:

2 cloves chopped garlic
..........
ingredient name: garlic
quantity: 2
measurement: cloves
preparation: chopped

1/2 teaspoon garlic powder
..........
ingredient name: garlic powder
quantity: 1/2
measurement: teaspoon
preparation:

1 teaspoon dried oregano, or to taste
..........
ingredient name: dried oregano
quantity: 1
measurement: teaspoon
preparation: or to taste

salt and ground black pepper to taste
..........
ingredient name: salt and ground black pepper to taste
quantity:
measurement:
preparation:

1 (16 ounce) package cottage cheese
..........
ingredient name: cottage cheese
quantity: 1 (16 ounce)
measurement: package
preparation:

2 eggs,
..........
ingredient name: eggs,
quantity: 2
measurement:
preparation:

1/2 cup shredded parmesan cheese
..........
ingredient name: shredded parmesan cheese
quantity: 1/2
measurement: cup
preparation:

1 1/2 (25 ounce) jars tomato-basil pasta sauce
..........
ingredient name: tomato-basil pasta sauce
quantity: 1 1/2 (25 ounce)
measurement: jars
preparation:

2 cups shredded mozzarella cheese
..........
ingredient name: shredded mozzarella cheese
quantity: 2
measurement: cups
preparation:

-------Tools-----
oven
pot
plate
skillet
bowl
pan
foil

-------Methods-----
preheat
boil
cook
uncovered
stirring
remove
chopping
drain
mix
combined
baking
top
sprinkle
brown
stand

-------Steps------
step 1
Preheat oven to 350 degrees F (175 degrees C)
..........
cooking tools: oven
cooking methods: preheat

step 2
Fill a large pot with lightly salted water and bring to a rolling boil over high heat
..........
ingredients: whole wheat, lasagna noodles cooking tools: pot
cooking methods: boil, heat

step 3
Once the water is boiling, add the lasagna noodles a few at a time, and return to a boil
..........
ingredients: whole wheat, lasagna noodles
cooking methods: boiling

step 4
Cook the pasta uncovered, stirring occasionally, until the pasta has cooked through, but is still firm to the bite, about 10 minutes
..........
ingredients: tomato-basil pasta sauce, whole wheat, lasagna noodles
cooking methods: cook, uncovered, stirring cooking time: 10 minutes

step 5
Remove the noodles to a plate
..........
ingredients: whole wheat, lasagna noodles cooking tools: plate
cooking methods: remove

step 6
Place the tofu into a skillet over medium heat, add the garlic, garlic powder, oregano, salt, and black pepper to the skillet
..........
ingredients: lean ground beef, whole wheat, lasagna noodles, garlic, garlic powder, dried oregano, salt and ground black pepper to taste
cooking tools: skillet
cooking methods: heat

step 7
Cook the tofu, chopping it into small chunks as it cooks, until no longer pink, about 10 minutes
..........
ingredients: whole wheat, lasagna noodles
cooking methods: cook, chopping
cooking time: 10 minutes

step 8
Drain excess grease
..........
cooking methods: drain

step 9
In a bowl, mix the cottage cheese, eggs, and Parmesan cheese until thoroughly combined
..........
ingredients: whole wheat, lasagna noodles, cottage cheese, eggs,
cooking tools: bowl
cooking methods: mix, combined

step 10
Place 4 noodles side by side into the bottom of a 9x13-inch baking pan
..........
ingredients: whole wheat, lasagna noodles cooking tools: pan
cooking methods: baking

step 11
top with a layer of the tomato-basil sauce, a layer of tofu mixture, and a layer of the cottage cheese mixture
..........
ingredients: tomato-basil pasta sauce, whole wheat, lasagna noodles, lean ground beef, cottage cheese
cooking methods: top, mixture

step 12
Repeat layers twice more, ending with a layer of sauce
..........
ingredients: whole wheat, lasagna noodles, tomato-basil pasta sauce

step 13
sprinkle top with the mozzarella cheese
..........
ingredients: shredded mozzarella cheese, cottage cheese
cooking methods: sprinkle, top

step 14
Cover the dish with aluminum foil
..........
cooking tools: foil
cooking methods: cover

step 15
Bake in the preheated oven until the casserole is bubbling and the cheese has melted, about 30 minutes
..........
ingredients: cottage cheese, whole wheat, lasagna noodles
cooking tools: oven
cooking methods: bake, preheated
cooking time: 30 minutes

step 16
Remove foil and bake until cheese has begun to brown, about 10 more minutes
..........
ingredients: cottage cheese, whole wheat, lasagna noodles
cooking tools: foil
cooking methods: remove, bake, brown
cooking time: 10 minutes

step 17
Allow to stand at least 10 minutes before serving
..........
cooking methods: stand
cooking time: 10 minutes

Do you want to continue transforming?
Press 1 to continue transforming
Press 2 to restart new recipe
Press 3 to quit the program

Please select your transformation:

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published