Upload risk_biased_dataset.py
Browse files- risk_biased_dataset.py +7 -4
risk_biased_dataset.py
CHANGED
|
@@ -20,7 +20,10 @@ _CITATION = """\
|
|
| 20 |
}
|
| 21 |
"""
|
| 22 |
|
| 23 |
-
_URL = "
|
|
|
|
|
|
|
|
|
|
| 24 |
|
| 25 |
class RiskBiasedDataset(datasets.GeneratorBasedBuilder):
|
| 26 |
"""Dataset of pre-processed samples from a portion of the
|
|
@@ -56,10 +59,10 @@ class RiskBiasedDataset(datasets.GeneratorBasedBuilder):
|
|
| 56 |
)
|
| 57 |
|
| 58 |
def _split_generators(self, dl_manager):
|
| 59 |
-
urls_to_download =
|
| 60 |
-
|
| 61 |
|
| 62 |
-
return [datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"filepath":
|
| 63 |
|
| 64 |
def _generate_examples(self, filepath, split):
|
| 65 |
"""Yields examples."""
|
|
|
|
| 20 |
}
|
| 21 |
"""
|
| 22 |
|
| 23 |
+
_URL = "https://huggingface.co/datasets/jmercat/risk_biased_dataset/resolve/main/"
|
| 24 |
+
_URLS = {
|
| 25 |
+
"test": _URL + "data.json",
|
| 26 |
+
}
|
| 27 |
|
| 28 |
class RiskBiasedDataset(datasets.GeneratorBasedBuilder):
|
| 29 |
"""Dataset of pre-processed samples from a portion of the
|
|
|
|
| 59 |
)
|
| 60 |
|
| 61 |
def _split_generators(self, dl_manager):
|
| 62 |
+
urls_to_download = _URLS
|
| 63 |
+
downloaded_files = dl_manager.download_and_extract(urls_to_download)
|
| 64 |
|
| 65 |
+
return [datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"filepath": downloaded_files["test"], "split": "test"}),]
|
| 66 |
|
| 67 |
def _generate_examples(self, filepath, split):
|
| 68 |
"""Yields examples."""
|