Datasets:
Commit
·
c0c7567
1
Parent(s):
fdd3e65
Update parquet files
Browse files- README.md +0 -111
- ica.json → default/recept-train.parquet +2 -2
- recept.py +0 -113
README.md
DELETED
|
@@ -1,111 +0,0 @@
|
|
| 1 |
-
---
|
| 2 |
-
annotations_creators:
|
| 3 |
-
- no-annotation
|
| 4 |
-
language:
|
| 5 |
-
- sv
|
| 6 |
-
language_creators:
|
| 7 |
-
- found
|
| 8 |
-
license:
|
| 9 |
-
- mit
|
| 10 |
-
multilinguality:
|
| 11 |
-
- monolingual
|
| 12 |
-
pretty_name: Recept
|
| 13 |
-
size_categories:
|
| 14 |
-
- 10K<n<100K
|
| 15 |
-
source_datasets:
|
| 16 |
-
- original
|
| 17 |
-
tags: []
|
| 18 |
-
task_categories:
|
| 19 |
-
- text-classification
|
| 20 |
-
task_ids: []
|
| 21 |
-
---
|
| 22 |
-
|
| 23 |
-
# Dataset Card for Recept
|
| 24 |
-
|
| 25 |
-
### Dataset Summary
|
| 26 |
-
|
| 27 |
-
[More Information Needed]
|
| 28 |
-
|
| 29 |
-
### Supported Tasks and Leaderboards
|
| 30 |
-
|
| 31 |
-
[More Information Needed]
|
| 32 |
-
|
| 33 |
-
### Languages
|
| 34 |
-
|
| 35 |
-
[More Information Needed]
|
| 36 |
-
|
| 37 |
-
## Dataset Structure
|
| 38 |
-
|
| 39 |
-
### Data Instances
|
| 40 |
-
|
| 41 |
-
[More Information Needed]
|
| 42 |
-
|
| 43 |
-
### Data Fields
|
| 44 |
-
|
| 45 |
-
[More Information Needed]
|
| 46 |
-
|
| 47 |
-
### Data Splits
|
| 48 |
-
|
| 49 |
-
[More Information Needed]
|
| 50 |
-
|
| 51 |
-
## Dataset Creation
|
| 52 |
-
|
| 53 |
-
### Curation Rationale
|
| 54 |
-
|
| 55 |
-
[More Information Needed]
|
| 56 |
-
|
| 57 |
-
### Source Data
|
| 58 |
-
|
| 59 |
-
#### Initial Data Collection and Normalization
|
| 60 |
-
|
| 61 |
-
[More Information Needed]
|
| 62 |
-
|
| 63 |
-
#### Who are the source language producers?
|
| 64 |
-
|
| 65 |
-
[More Information Needed]
|
| 66 |
-
|
| 67 |
-
### Annotations
|
| 68 |
-
|
| 69 |
-
#### Annotation process
|
| 70 |
-
|
| 71 |
-
[More Information Needed]
|
| 72 |
-
|
| 73 |
-
#### Who are the annotators?
|
| 74 |
-
|
| 75 |
-
[More Information Needed]
|
| 76 |
-
|
| 77 |
-
### Personal and Sensitive Information
|
| 78 |
-
|
| 79 |
-
[More Information Needed]
|
| 80 |
-
|
| 81 |
-
## Considerations for Using the Data
|
| 82 |
-
|
| 83 |
-
### Social Impact of Dataset
|
| 84 |
-
|
| 85 |
-
[More Information Needed]
|
| 86 |
-
|
| 87 |
-
### Discussion of Biases
|
| 88 |
-
|
| 89 |
-
[More Information Needed]
|
| 90 |
-
|
| 91 |
-
### Other Known Limitations
|
| 92 |
-
|
| 93 |
-
[More Information Needed]
|
| 94 |
-
|
| 95 |
-
## Additional Information
|
| 96 |
-
|
| 97 |
-
### Dataset Curators
|
| 98 |
-
|
| 99 |
-
[More Information Needed]
|
| 100 |
-
|
| 101 |
-
### Licensing Information
|
| 102 |
-
|
| 103 |
-
[More Information Needed]
|
| 104 |
-
|
| 105 |
-
### Citation Information
|
| 106 |
-
|
| 107 |
-
[More Information Needed]
|
| 108 |
-
|
| 109 |
-
### Contributions
|
| 110 |
-
|
| 111 |
-
[More Information Needed]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ica.json → default/recept-train.parquet
RENAMED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9bf2ea60d7116c5fd1a3df34c2d407d6e6c7d966dccac6778be0b7584d74de95
|
| 3 |
+
size 6363973
|
recept.py
DELETED
|
@@ -1,113 +0,0 @@
|
|
| 1 |
-
import json
|
| 2 |
-
|
| 3 |
-
import datasets
|
| 4 |
-
|
| 5 |
-
_DESCRIPTION = "Recipes scraped from ICA.se"
|
| 6 |
-
|
| 7 |
-
_TRAIN_DOWNLOAD_URL = "./ica.json"
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
difficulty_translations = {
|
| 11 |
-
"Enkel": "easy",
|
| 12 |
-
"Medel": "medium",
|
| 13 |
-
"Avancerad": "hard",
|
| 14 |
-
}
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
difficulties = ["easy", "medium", "hard"]
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
class Recept(datasets.GeneratorBasedBuilder):
|
| 21 |
-
def _info(self):
|
| 22 |
-
return datasets.DatasetInfo(
|
| 23 |
-
description=_DESCRIPTION,
|
| 24 |
-
features=datasets.Features(
|
| 25 |
-
{
|
| 26 |
-
"id": datasets.Value("int32"),
|
| 27 |
-
"title": datasets.Value("string"),
|
| 28 |
-
"preamble": datasets.Value("string"),
|
| 29 |
-
"url": datasets.Value("string"),
|
| 30 |
-
"cooking_time": datasets.Value("string"),
|
| 31 |
-
"difficulty": datasets.ClassLabel(names=difficulties),
|
| 32 |
-
"categories": datasets.Sequence(datasets.Value("string")),
|
| 33 |
-
"rating": datasets.Value("float32"),
|
| 34 |
-
"reviews": datasets.Value("int32"),
|
| 35 |
-
"instructions": datasets.Sequence(datasets.Value("string")),
|
| 36 |
-
"ingredients": datasets.Sequence(
|
| 37 |
-
{
|
| 38 |
-
"heading": datasets.Value("string"),
|
| 39 |
-
"list": datasets.Sequence(
|
| 40 |
-
{
|
| 41 |
-
"name": datasets.Value("string"),
|
| 42 |
-
"amount": datasets.Value("string"),
|
| 43 |
-
}
|
| 44 |
-
),
|
| 45 |
-
}
|
| 46 |
-
),
|
| 47 |
-
"nutrition": {
|
| 48 |
-
"energy": datasets.Value("string"),
|
| 49 |
-
"fat": datasets.Value("string"),
|
| 50 |
-
"salt": datasets.Value("string"),
|
| 51 |
-
"carbohydrates": datasets.Value("string"),
|
| 52 |
-
"protein": datasets.Value("string"),
|
| 53 |
-
},
|
| 54 |
-
}
|
| 55 |
-
),
|
| 56 |
-
)
|
| 57 |
-
|
| 58 |
-
def _split_generators(self, dl_manager):
|
| 59 |
-
train_path = dl_manager.download_and_extract(_TRAIN_DOWNLOAD_URL)
|
| 60 |
-
return [
|
| 61 |
-
datasets.SplitGenerator(
|
| 62 |
-
name=datasets.Split.TRAIN, gen_kwargs={"filepath": train_path}
|
| 63 |
-
),
|
| 64 |
-
]
|
| 65 |
-
|
| 66 |
-
def _generate_examples(self, filepath):
|
| 67 |
-
with open(filepath, encoding="utf8") as file:
|
| 68 |
-
for row in file:
|
| 69 |
-
recipe = json.loads(row)
|
| 70 |
-
difficulty = recipe.get("difficulty")
|
| 71 |
-
if difficulty is not None:
|
| 72 |
-
difficulty = difficulties.index(difficulty_translations[difficulty])
|
| 73 |
-
|
| 74 |
-
ingredient_sections = []
|
| 75 |
-
|
| 76 |
-
for section in recipe["ingredients"]:
|
| 77 |
-
ingredients = []
|
| 78 |
-
for ingredient in section["list"]:
|
| 79 |
-
ingredients.append(
|
| 80 |
-
{
|
| 81 |
-
"name": ingredient["ingr"],
|
| 82 |
-
"amount": ingredient["qty"],
|
| 83 |
-
}
|
| 84 |
-
)
|
| 85 |
-
ingredient_sections.append(
|
| 86 |
-
{
|
| 87 |
-
"heading": section["heading"],
|
| 88 |
-
"list": ingredients,
|
| 89 |
-
}
|
| 90 |
-
)
|
| 91 |
-
|
| 92 |
-
nutrition = recipe["nutrition"]
|
| 93 |
-
|
| 94 |
-
yield recipe["id"], {
|
| 95 |
-
"id": recipe["id"],
|
| 96 |
-
"title": recipe["title"],
|
| 97 |
-
"preamble": recipe["preamble"],
|
| 98 |
-
"url": recipe["absoluteUrl"],
|
| 99 |
-
"cooking_time": recipe.get("cookingTime"),
|
| 100 |
-
"difficulty": difficulty,
|
| 101 |
-
"categories": recipe["categories"],
|
| 102 |
-
"rating": recipe["rating"]["averageRating"],
|
| 103 |
-
"reviews": recipe["rating"]["numberOfVotes"],
|
| 104 |
-
"instructions": recipe["instructions"],
|
| 105 |
-
"ingredients": ingredient_sections,
|
| 106 |
-
"nutrition": {
|
| 107 |
-
"energy": nutrition.get("energy"),
|
| 108 |
-
"fat": nutrition.get("fat"),
|
| 109 |
-
"salt": nutrition.get("salt"),
|
| 110 |
-
"carbohydrates": nutrition.get("carbohydrates"),
|
| 111 |
-
"protein": nutrition.get("protein"),
|
| 112 |
-
},
|
| 113 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|