Datasets:
add load script
Browse files- README.md +110 -0
- skolmat.py +41 -0
README.md
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
annotations_creators:
|
| 3 |
+
- expert-generated
|
| 4 |
+
language:
|
| 5 |
+
- sv
|
| 6 |
+
language_creators:
|
| 7 |
+
- found
|
| 8 |
+
license:
|
| 9 |
+
- mit
|
| 10 |
+
multilinguality:
|
| 11 |
+
- monolingual
|
| 12 |
+
pretty_name: Skolmat
|
| 13 |
+
size_categories: []
|
| 14 |
+
source_datasets:
|
| 15 |
+
- original
|
| 16 |
+
tags: []
|
| 17 |
+
task_categories:
|
| 18 |
+
- text-classification
|
| 19 |
+
task_ids: []
|
| 20 |
+
---
|
| 21 |
+
|
| 22 |
+
# Dataset Card for Skolmat
|
| 23 |
+
|
| 24 |
+
### Dataset Summary
|
| 25 |
+
|
| 26 |
+
[More Information Needed]
|
| 27 |
+
|
| 28 |
+
### Supported Tasks and Leaderboards
|
| 29 |
+
|
| 30 |
+
[More Information Needed]
|
| 31 |
+
|
| 32 |
+
### Languages
|
| 33 |
+
|
| 34 |
+
[More Information Needed]
|
| 35 |
+
|
| 36 |
+
## Dataset Structure
|
| 37 |
+
|
| 38 |
+
### Data Instances
|
| 39 |
+
|
| 40 |
+
[More Information Needed]
|
| 41 |
+
|
| 42 |
+
### Data Fields
|
| 43 |
+
|
| 44 |
+
[More Information Needed]
|
| 45 |
+
|
| 46 |
+
### Data Splits
|
| 47 |
+
|
| 48 |
+
[More Information Needed]
|
| 49 |
+
|
| 50 |
+
## Dataset Creation
|
| 51 |
+
|
| 52 |
+
### Curation Rationale
|
| 53 |
+
|
| 54 |
+
[More Information Needed]
|
| 55 |
+
|
| 56 |
+
### Source Data
|
| 57 |
+
|
| 58 |
+
#### Initial Data Collection and Normalization
|
| 59 |
+
|
| 60 |
+
[More Information Needed]
|
| 61 |
+
|
| 62 |
+
#### Who are the source language producers?
|
| 63 |
+
|
| 64 |
+
[More Information Needed]
|
| 65 |
+
|
| 66 |
+
### Annotations
|
| 67 |
+
|
| 68 |
+
#### Annotation process
|
| 69 |
+
|
| 70 |
+
[More Information Needed]
|
| 71 |
+
|
| 72 |
+
#### Who are the annotators?
|
| 73 |
+
|
| 74 |
+
[More Information Needed]
|
| 75 |
+
|
| 76 |
+
### Personal and Sensitive Information
|
| 77 |
+
|
| 78 |
+
[More Information Needed]
|
| 79 |
+
|
| 80 |
+
## Considerations for Using the Data
|
| 81 |
+
|
| 82 |
+
### Social Impact of Dataset
|
| 83 |
+
|
| 84 |
+
[More Information Needed]
|
| 85 |
+
|
| 86 |
+
### Discussion of Biases
|
| 87 |
+
|
| 88 |
+
[More Information Needed]
|
| 89 |
+
|
| 90 |
+
### Other Known Limitations
|
| 91 |
+
|
| 92 |
+
[More Information Needed]
|
| 93 |
+
|
| 94 |
+
## Additional Information
|
| 95 |
+
|
| 96 |
+
### Dataset Curators
|
| 97 |
+
|
| 98 |
+
[More Information Needed]
|
| 99 |
+
|
| 100 |
+
### Licensing Information
|
| 101 |
+
|
| 102 |
+
[More Information Needed]
|
| 103 |
+
|
| 104 |
+
### Citation Information
|
| 105 |
+
|
| 106 |
+
[More Information Needed]
|
| 107 |
+
|
| 108 |
+
### Contributions
|
| 109 |
+
|
| 110 |
+
[More Information Needed]
|
skolmat.py
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import csv
|
| 2 |
+
|
| 3 |
+
import datasets
|
| 4 |
+
|
| 5 |
+
_DESCRIPTION = "Swedish school lunches."
|
| 6 |
+
|
| 7 |
+
_TRAIN_DOWNLOAD_URL = "./meals.csv"
|
| 8 |
+
|
| 9 |
+
labels = ["r", "fest", "kv", "tb", "cat", "msg", "no", "typ"]
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
class MealsSv(datasets.GeneratorBasedBuilder):
|
| 13 |
+
def _info(self):
|
| 14 |
+
return datasets.DatasetInfo(
|
| 15 |
+
description=_DESCRIPTION,
|
| 16 |
+
features=datasets.Features(
|
| 17 |
+
{
|
| 18 |
+
"meal": datasets.Value("string"),
|
| 19 |
+
"label": datasets.features.ClassLabel(names=labels),
|
| 20 |
+
}
|
| 21 |
+
),
|
| 22 |
+
)
|
| 23 |
+
|
| 24 |
+
def _split_generators(self, dl_manager):
|
| 25 |
+
train_path = dl_manager.download_and_extract(_TRAIN_DOWNLOAD_URL)
|
| 26 |
+
return [
|
| 27 |
+
datasets.SplitGenerator(
|
| 28 |
+
name=datasets.Split.TRAIN, gen_kwargs={"filepath": train_path}
|
| 29 |
+
),
|
| 30 |
+
]
|
| 31 |
+
|
| 32 |
+
def _generate_examples(self, filepath):
|
| 33 |
+
with open(filepath, encoding="utf8") as csv_file:
|
| 34 |
+
reader = csv.reader(csv_file)
|
| 35 |
+
next(reader, None) # skip the headers
|
| 36 |
+
for i, row in enumerate(reader):
|
| 37 |
+
(meal, label) = row
|
| 38 |
+
yield i, {
|
| 39 |
+
"meal": meal,
|
| 40 |
+
"label": label,
|
| 41 |
+
}
|