Support streaming
#1
by
albertvillanova
HF Staff
- opened
- bioinfer.py +7 -8
bioinfer.py
CHANGED
|
@@ -68,7 +68,10 @@ _HOMEPAGE = "https://github.com/metalrt/ppi-dataset"
|
|
| 68 |
_LICENSE = 'Creative Commons Attribution 2.0 Generic'
|
| 69 |
|
| 70 |
_URLS = {
|
| 71 |
-
_DATASETNAME:
|
|
|
|
|
|
|
|
|
|
| 72 |
}
|
| 73 |
|
| 74 |
_SUPPORTED_TASKS = [Tasks.RELATION_EXTRACTION, Tasks.NAMED_ENTITY_RECOGNITION]
|
|
@@ -157,23 +160,19 @@ class BioinferDataset(datasets.GeneratorBasedBuilder):
|
|
| 157 |
def _split_generators(self, dl_manager) -> List[datasets.SplitGenerator]:
|
| 158 |
"""Returns SplitGenerators."""
|
| 159 |
urls = _URLS[_DATASETNAME]
|
| 160 |
-
data_dir = dl_manager.
|
| 161 |
return [
|
| 162 |
datasets.SplitGenerator(
|
| 163 |
name=datasets.Split.TRAIN,
|
| 164 |
gen_kwargs={
|
| 165 |
-
"filepath":
|
| 166 |
-
data_dir, "ppi-dataset-master/csv_output/BioInfer-train.xml"
|
| 167 |
-
),
|
| 168 |
"split": "train",
|
| 169 |
},
|
| 170 |
),
|
| 171 |
datasets.SplitGenerator(
|
| 172 |
name=datasets.Split.TEST,
|
| 173 |
gen_kwargs={
|
| 174 |
-
"filepath":
|
| 175 |
-
data_dir, "ppi-dataset-master/csv_output/BioInfer-test.xml"
|
| 176 |
-
),
|
| 177 |
"split": "test",
|
| 178 |
},
|
| 179 |
),
|
|
|
|
| 68 |
_LICENSE = 'Creative Commons Attribution 2.0 Generic'
|
| 69 |
|
| 70 |
_URLS = {
|
| 71 |
+
_DATASETNAME: {
|
| 72 |
+
"train": "https://github.com/metalrt/ppi-dataset/raw/master/csv_output/BioInfer-train.xml",
|
| 73 |
+
"test": "https://github.com/metalrt/ppi-dataset/raw/master/csv_output/BioInfer-test.xml",
|
| 74 |
+
}
|
| 75 |
}
|
| 76 |
|
| 77 |
_SUPPORTED_TASKS = [Tasks.RELATION_EXTRACTION, Tasks.NAMED_ENTITY_RECOGNITION]
|
|
|
|
| 160 |
def _split_generators(self, dl_manager) -> List[datasets.SplitGenerator]:
|
| 161 |
"""Returns SplitGenerators."""
|
| 162 |
urls = _URLS[_DATASETNAME]
|
| 163 |
+
data_dir = dl_manager.download(urls)
|
| 164 |
return [
|
| 165 |
datasets.SplitGenerator(
|
| 166 |
name=datasets.Split.TRAIN,
|
| 167 |
gen_kwargs={
|
| 168 |
+
"filepath": data_dir["train"],
|
|
|
|
|
|
|
| 169 |
"split": "train",
|
| 170 |
},
|
| 171 |
),
|
| 172 |
datasets.SplitGenerator(
|
| 173 |
name=datasets.Split.TEST,
|
| 174 |
gen_kwargs={
|
| 175 |
+
"filepath": data_dir["test"],
|
|
|
|
|
|
|
| 176 |
"split": "test",
|
| 177 |
},
|
| 178 |
),
|