m3hrdadfi commited on
Commit
04e1f9c
1 Parent(s): 1ab112f

Hello recipe_nlg_lite

Browse files
Files changed (3) hide show
  1. README.md +58 -0
  2. dataset_infos.json +1 -0
  3. recipe_nlg_lite.py +96 -0
README.md ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # RecipeNLG: A Cooking Recipes Dataset
2
+ RecipeNLG: A Cooking Recipes Dataset for Semi-Structured Text Generation - Lite version
3
+
4
+ The dataset we publish contains `7,198` cooking recipes (`>7K`).
5
+ It's processed in more careful way and provides more samples than any other dataset in the area.
6
+
7
+ ## How to use
8
+
9
+ ```bash
10
+ pip install git+https://github.com/huggingface/datasets.git
11
+ ```
12
+
13
+ Load `recipe_nlg_lite` dataset using `load_dataset`:
14
+
15
+ ```python
16
+ from datasets import load_dataset
17
+
18
+
19
+ dataset = load_dataset("m3hrdadfi/recipe_nlg_lite")
20
+ print(dataset)
21
+ ```
22
+
23
+ Output:
24
+ ```text
25
+ DatasetDict({
26
+ train: Dataset({
27
+ features: ['uid', 'name', 'description', 'link', 'ner', 'ingredients', 'steps'],
28
+ num_rows: 6118
29
+ })
30
+ test: Dataset({
31
+ features: ['uid', 'name', 'description', 'link', 'ner', 'ingredients', 'steps'],
32
+ num_rows: 1080
33
+ })
34
+ })
35
+ ```
36
+
37
+ ### Examples
38
+
39
+ | | uid | name | description | link | ner | ingredients | steps |
40
+ |-----:|:-------------------------------------|:----------------------------------------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:--------------------------------------------------------------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
41
+ | 759 | f7f906e2-1523-405e-86c6-5d1de708ad8a | sheet pan mini meat loaves | an american classic made miniature and on a sheet pan . a meatloaf dinner with easy prep and easier clean up. | https://www.yummly.com/private/recipe/Sheet-Pan-Mini-Meat-Loaves-9073110?layout=prep-steps | nonstick spray, large egg, yellow onion, garlic, ketchup, grated pecorino cheese, dried basil, fine sea salt, black pepper, ground beef, ketchup, apple cider vinegar, brown sugar, asparagus, extra virgin olive oil, fine sea salt | nonstick spray, 1.0 large egg, 0.5 cup yellow onion, 2.0 clove garlic, 3.0 tablespoon ketchup, 0.2 cup grated pecorino cheese, 1.0 teaspoon dried basil, 1.0 teaspoon fine sea salt, 1.0 teaspoon black pepper, 1.0 pound ground beef, 3.0 tablespoon ketchup, 1.0 teaspoon apple cider vinegar, 1.0 tablespoon brown sugar, 1.0 pound asparagus, 1.0 tablespoon extra virgin olive oil, 0.2 teaspoon fine sea salt | preheat the oven to 375degf . spray a large baking sheet with nonstick cooking spray . set aside . in a small bowl, whisk the egg . in a large mixing bowl, mix together the onion, garlic, ketchup, cheese, and basil . add the whisked egg and stir . add the beef, and mix together with a spoon or your hands until well combined . divide the meat mixture into 4 equal portions and shape into miniature loaves . arrange the loaves on the prepared baking sheet . in a small bowl, whisk together the ketchup, apple cider vinegar and brown sugar . spoon the sauce evenly over the loaves . bake the meat loaves on middle rack of oven for 15 minutes . while meat loaves are baking, wash, dry and trim the asparagus . toss the asparagus with the olive oil and salt . remove baking sheet from the oven, and nestle the asparagus around the loaves . continue baking until meat loaves are cooked through, about 15 minutes . check to see that meat loaves are done . remove from oven or add time as needed . plate each meat loaf with a portion of asparagus and serve immediately. |
42
+ | 1776 | 2b44648c-0bb5-4541-a829-9669d5552574 | japanese pork curry, fermented corn, pickled rat tail radishes, lemon koshu | japanese pork curry, fermented corn, pickled rat tail radishes, lemon koshu with extra virgin olive oil, cumin seed, pork loin, unsalted butter, medium carrot, yellow onion, celery, garlic, fresh ginger, tomato ketchup, paprika, hatcho miso, pork stock, yukon gold potatoes, japanese brick curry, bay leaf, rice vinegar, salt, pepper, corn kernels, water, salt, radishes, rice vinegar, garlic, water, sugar, crushed red pepper flakes, lemon peel, yellow wax pepper, salt, sugar | https://www.yummly.com/private/recipe/Japanese-Pork-Curry_-Fermented-Corn_-Pickled-Rat-Tail-Radishes_-Lemon-Koshu-2255207?layout=prep-steps | extra virgin olive oil, cumin seed, pork loin, unsalted butter, medium carrot, yellow onion, celery, garlic, fresh ginger, tomato ketchup, paprika, hatcho miso, pork stock, yukon gold potatoes, japanese brick curry, bay leaf, rice vinegar, salt, pepper, corn kernels, water, salt, radishes, rice vinegar, garlic, water, sugar, crushed red pepper flakes, lemon peel, yellow wax pepper, salt, sugar | 1.0 tablespoon extra virgin olive oil, 1.0 tablespoon cumin seed, 1.3 pound pork loin, 1.0 tablespoon unsalted butter, 2.0 medium carrot, 1.0 yellow onion, 1.0 stalk celery, 1.0 clove garlic, 0.5 inch fresh ginger, 1.0 tablespoon tomato ketchup, 1.0 tablespoon paprika, 1.5 teaspoon hatcho miso, 1.0 cup pork stock, 2.0 yukon gold potatoes, 0.5 inch japanese brick curry, 1.0 bay leaf, 2.0 teaspoon rice vinegar, salt, pepper, 0.7 cup corn kernels, 0.5 cup water, 0.8 teaspoon salt, 0.7 cup radishes, 0.3 cup rice vinegar, 4.0 clove garlic, 2.0 tablespoon water, 0.3 cup sugar, 1.0 pinch crushed red pepper flakes, 1.2 cup lemon peel, 0.3 cup yellow wax pepper, 1.5 teaspoon salt, 0.8 teaspoon sugar | 1. for the curry in a donabe or dutch oven, toast the cumin seeds in the oil and then add the pork loin . start to get color on the pork and add butter and sweat the vegetables, once they start to get translucent add rest of ingredients except for the rice vinegar . simmer until pork is tender and the sauce has thickened and season with the rice vinegar . 2. for the corn dissolve salt into the water and place in a vacuum sealed bag and seal on medium pressure and leave at room temp for 7 weeks . place in cooler until use . 3. for the rat tail radish bring all ingredients except for the radishes to a boil and pour over the radishes . cool and reserve . 4. for the lemon koshu blend all ingredients together into a smooth paste and vacuum seal at high pressure and let set at room temp for 3 weeks until ready to use. |
43
+ | 2882 | ca7480a9-fca9-447e-b198-442529cd8214 | grilled rosemary and cherry glazed rack of lamb | a rack of lamb is buttery tender and a dramatic cut to cook on your grill . a simple fresh herb and mustard rub, followed by a tart sweet glaze at the last minute, take the meat into splurge territory . to eliminate flare ups, be sure to have your butcher trim the meat and fat between the bones, a technique called frenching, and also trim the fat from the meat on the main loin part of the rack . for perfect browning, set up your grill with areas for both direct heat and indirect heat . the recipe is designed especially for the yummly smart thermometer https //www.yummly.com/thermometer but if you don't have one, check the meat's temperature using an instant read . the recipe is a yummly original created by david bonom https //www.yummly.com/dish/author/david bonom . | https://www.yummly.com/private/recipe/Grilled-Rosemary-and-Cherry-Glazed-Rack-of-Lamb-9230947?layout=prep-steps | fresh rosemary, extra virgin olive oil, dijon mustard, salt, garlic powder, black pepper, rack of lamb, cherry preserves, balsamic vinegar | 1.5 tablespoon fresh rosemary, 1.5 tablespoon extra virgin olive oil, 1.5 tablespoon dijon mustard, 1.0 teaspoon salt, 1.0 teaspoon garlic powder, 0.8 teaspoon black pepper, 1.0 rack of lamb, 0.3 cup cherry preserves, 1.5 teaspoon balsamic vinegar | combine the rosemary, olive oil, mustard, salt, garlic powder, and pepper in a small bowl . wrap the lamb bones with foil . set lamb on a plate and brush rosemary mixture all over the meat . cover and refrigerate 1 to 4 hours . meanwhile, combine preserves and vinegar in a small bowl and set aside in the refrigerator . preheat a grill for both direct and indirect medium heat grilling 350deg to 450deg . for gas, leave one burner turned off . for charcoal, spread coals over only two thirds of fire grate the area with no coals is for indirect heat . set the cooking grate in place . following the insertion guide on the yummly thermometer app, insert the thermometer horizontally through an end of the lamb into the meat until the metal is completely covered . starting with the bony side down, grill lamb over direct heat with the lid closed . cook, turning once, until meat is browned, about 5 minutes . transfer lamb to indirect heat with the meaty side up . cook until the temperature of the lamb registers about 5deg short of your cooking target, or about 125deg and 15 20 minutes if you're aiming for medium rare . turn lamb bony side up and return it to direct heat if you'd like the meaty side to be browner . brush the top with some of the preserve mixture, cover, and cook about 2 minutes until jam is somewhat set . turn lamb over, brush with the remaining jam mixture, and grill 1 minute longer . at this point the lamb should be at your target temperature about 130deg for medium rare, but if not, grill it a little longer over indirect heat . transfer lamb to a cutting board and let rest 5 minutes before cutting into individual chops. |
44
+ | 3848 | ca3a1c2d-63ed-4062-a56b-4dda5c41faae | quinoa bowl lc | quinoa bowl lc with cooked quinoa, olive oil | https://www.yummly.com/private/recipe/Quinoa-Bowl-LC-770993?layout=prep-steps | cooked quinoa, olive oil | 2.0 cup cooked quinoa, 0.2 cup olive oil | 1. for the quinoa in a pot over medium heat bring 1 cup of quinoa and 2 cups of seasoned vegetable stock to a boil remember that however your liquid tastes is how your grain will taste . reduce to a simmer, cover and cook covered until all water is absorbed . approximately 12 15 minutes . when done, remove from heat and keep covered . 2. to blanch your broccoli bring two cups of salted water to a boil . prepare an ice bath to cool the broccoli after cooking . cut broccoli into 1 inch pieces and then drop into boiling water . cook for approximately 2 minutes until bright green and tender but still firm . remove from boiling water and drop into ice bath to stop cooking process . drain and then cut broccoli into thin pieces lengthwise . 3. assembly place your quinoa on the bottom of your bowl . layer your carrots, tomatoes, broccoli, kidney beans and sliced red onions on top of the quinoa . 4. making the harvest dressing add all dressing ingredients in a blender and pulse . then, drizzle bowl with dressing. |
45
+ | 4538 | 783818a9-e105-476d-97b7-94cf658e0b70 | asian pork and shrimp noodles w/cocomilk | this is a pork and shrimp noodles with dried fungus, mushroom cooked with cocomilk and oyster sauce | https://www.yummly.com/private/recipe/Asian-Pork-And-Shrimp-Noodles-w_Cocomilk-1201724?layout=prep-steps | pork ribs, shrimps, mushroom, mushroom, coconut milk, oyster sauce, monosodium glutamate, salt, minced garlic, minced onion, egg, pepper, noodles, soy sauce, msg | pork ribs, shrimps, mushroom, mushroom, coconut milk, oyster sauce, monosodium glutamate, 1.0 pinch salt, minced garlic, minced onion, 1.0 egg, pepper, noodles, soy sauce, 1.0 pinch msg | boil pork ribs till it softens then add the shrimp to cook . separate the soup stock and put in the chiller . on the other side, soak the dried fungus and dried mushroom till it softens take out the pork ribs and shrimp and marinate in in oyster sauce, vinegar, soy sauce and crushed peppercorn and let it sit and absorb the ingredients wash the noodles if you're using fresh noodles or you can use dried noodles . and have it added on the stock when it boils boil the stock and add two tablespoons of oyster sauce and 1/4 cup of coconut milk, minced garlic and onion and a pinch of salt and msg add the noodles to the boiling stock including the pork ribs including the dried fungus and dried mushroom till it softens once the noodles are soft, add the shrimps and egg . stir the soup stock to enable the soup to thicken due to the egg in less than 2 minutes time the food is ready . place it in a bowl and enjoy your soup |
46
+
47
+
48
+ ## Citation
49
+ ```bibtex
50
+ @misc{RecipeNLGLite,
51
+ author = {Mehrdad Farahani},
52
+ title = {RecipeNLG: A Cooking Recipes Dataset for Semi-Structured Text Generation (Lite)},
53
+ year = 2021,
54
+ publisher = {GitHub},
55
+ journal = {GitHub repository},
56
+ howpublished = {url{https://github.com/m3hrdadfi/recipe-nlg-lite}},
57
+ }
58
+ ```
dataset_infos.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"1.0.0": {"description": "\nRecipeNLG: A Cooking Recipes Dataset for Semi-Structured Text Generation - Lite version\nThe dataset we publish contains 7,198 cooking recipes (>7K). \nIt's processed in more careful way and provides more samples than any other dataset in the area.", "citation": "\n@misc{RecipeNLGLite, \n author = {Mehrdad Farahani},\n title = {RecipeNLG: A Cooking Recipes Dataset for Semi-Structured Text Generation (Lite)},\n year = 2021,\n publisher = {GitHub},\n journal = {GitHub repository},\n howpublished = {url{https://github.com/m3hrdadfi/recipe-nlg-lite}},\n} \n", "homepage": "https://github.com/m3hrdadfi/recipe-nlg-lite", "license": "", "features": {"uid": {"dtype": "string", "id": null, "_type": "Value"}, "name": {"dtype": "string", "id": null, "_type": "Value"}, "description": {"dtype": "string", "id": null, "_type": "Value"}, "link": {"dtype": "string", "id": null, "_type": "Value"}, "ner": {"dtype": "string", "id": null, "_type": "Value"}, "ingredients": {"dtype": "string", "id": null, "_type": "Value"}, "steps": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "builder_name": "recipe_nlg_lite", "config_name": "1.0.0", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 9672370, "num_examples": 6118, "dataset_name": "recipe_nlg_lite"}, "test": {"name": "test", "num_bytes": 1695007, "num_examples": 1080, "dataset_name": "recipe_nlg_lite"}}, "download_checksums": {"https://drive.google.com/uc?id=1PGH5H_oW7wUvMw_5xaXvbEN7DFll-wDX": {"num_bytes": 6712146, "checksum": "01253c8f4f1ab03734456cc5d2601dd196b74775de3ba4faa12708df36004e7e"}}, "download_size": 6712146, "post_processing_size": null, "dataset_size": 11367377, "size_in_bytes": 18079523}}
recipe_nlg_lite.py ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import csv
2
+ import os
3
+
4
+ import datasets
5
+
6
+ _CITATION = """
7
+ @misc{RecipeNLGLite,
8
+ author = {Mehrdad Farahani},
9
+ title = {RecipeNLG: A Cooking Recipes Dataset for Semi-Structured Text Generation (Lite)},
10
+ year = 2021,
11
+ publisher = {GitHub},
12
+ journal = {GitHub repository},
13
+ howpublished = {url{https://github.com/m3hrdadfi/recipe-nlg-lite}},
14
+ }
15
+ """
16
+
17
+ _DESCRIPTION = """
18
+ RecipeNLG: A Cooking Recipes Dataset for Semi-Structured Text Generation - Lite version
19
+ The dataset we publish contains 7,198 cooking recipes (>7K).
20
+ It's processed in more careful way and provides more samples than any other dataset in the area."""
21
+
22
+ _HOMEPAGE = "https://github.com/m3hrdadfi/recipe-nlg-lite"
23
+ _LICENSE = "MIT License"
24
+
25
+ _URLs = {
26
+ "1.0.0": {
27
+ "data": "https://drive.google.com/uc?id=1PGH5H_oW7wUvMw_5xaXvbEN7DFll-wDX",
28
+ "features": [
29
+ {"name": "uid", "type": datasets.Value("string")},
30
+ {"name": "name", "type": datasets.Value("string")},
31
+ {"name": "description", "type": datasets.Value("string")},
32
+ {"name": "link", "type": datasets.Value("string")},
33
+ {"name": "ner", "type": datasets.Value("string")},
34
+ {"name": "ingredients", "type": datasets.Value("string")},
35
+ {"name": "steps", "type": datasets.Value("string")},
36
+ ],
37
+ }
38
+ }
39
+
40
+
41
+ class RecipeNLGLiteConfig(datasets.BuilderConfig):
42
+ """BuilderConfig for RecipeNLGLite."""
43
+
44
+ def __init__(self, **kwargs):
45
+ """BuilderConfig for RecipeNLGLite.
46
+ Args:
47
+ **kwargs: keyword arguments forwarded to super.
48
+ """
49
+ super(RecipeNLGLiteConfig, self).__init__(**kwargs)
50
+
51
+
52
+ class RecipeNLGLite(datasets.GeneratorBasedBuilder):
53
+ BUILDER_CONFIGS = [
54
+ RecipeNLGLiteConfig(
55
+ name="1.0.0", version=datasets.Version("1.0.0"), description="The first version of recipe_nlg_lite"
56
+ ),
57
+ ]
58
+
59
+ def _info(self):
60
+ feature_names_types = _URLs[self.config.name]["features"]
61
+ features = datasets.Features({f["name"]: f["type"] for f in feature_names_types})
62
+
63
+ return datasets.DatasetInfo(
64
+ description=_DESCRIPTION, features=features, homepage=_HOMEPAGE, citation=_CITATION
65
+ )
66
+
67
+ def _split_generators(self, dl_manager):
68
+ my_urls = _URLs[self.config.name]
69
+ data_dir = dl_manager.download_and_extract(my_urls["data"])
70
+
71
+ return [
72
+ datasets.SplitGenerator(
73
+ name=datasets.Split.TRAIN,
74
+ gen_kwargs={
75
+ "filepath": os.path.join(data_dir, "recipe_nlg_lite", "train.csv"),
76
+ "split": "train",
77
+ },
78
+ ),
79
+ datasets.SplitGenerator(
80
+ name=datasets.Split.TEST,
81
+ gen_kwargs={
82
+ "filepath": os.path.join(data_dir, "recipe_nlg_lite", "test.csv"),
83
+ "split": "test",
84
+ },
85
+ ),
86
+ ]
87
+
88
+ def _generate_examples(self, filepath, split):
89
+ feature_names_types = _URLs[self.config.name]["features"]
90
+ features = [f["name"] for f in feature_names_types]
91
+ with open(filepath, encoding="utf-8") as csv_file:
92
+ reader = csv.DictReader(csv_file, quotechar='"', delimiter="\t", quoting=csv.QUOTE_MINIMAL)
93
+
94
+ for _id, row in enumerate(reader):
95
+ if len(row) == len(features):
96
+ yield _id, {f: row[f] for f in features}