Update Mimic4Dataset.py
Browse files- Mimic4Dataset.py +8 -4
Mimic4Dataset.py
CHANGED
@@ -29,7 +29,7 @@ class Mimic4DatasetConfig(datasets.BuilderConfig):
|
|
29 |
):
|
30 |
super().__init__(**kwargs)
|
31 |
self.mimic_path =mimic_path
|
32 |
-
|
33 |
#self.config = config
|
34 |
#cohort.task_cohort(self.task,self.mimic_path)
|
35 |
|
@@ -128,15 +128,19 @@ class Mimic4Dataset(datasets.GeneratorBasedBuilder):
|
|
128 |
citation=_CITATION,
|
129 |
)
|
130 |
|
131 |
-
def _split_generators(self, dl_manager):
|
132 |
data_dir = self.config.data_dir + "/dataDic"
|
133 |
#mimic=self.mimic_path
|
|
|
|
|
|
|
134 |
return [
|
135 |
-
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": data_dir}),
|
136 |
]
|
137 |
|
138 |
|
139 |
-
def _generate_examples(self, filepath):
|
|
|
140 |
with open(filepath, 'rb') as fp:
|
141 |
dataDic = pickle.load(fp)
|
142 |
for hid, data in dataDic.items():
|
|
|
29 |
):
|
30 |
super().__init__(**kwargs)
|
31 |
self.mimic_path =mimic_path
|
32 |
+
|
33 |
#self.config = config
|
34 |
#cohort.task_cohort(self.task,self.mimic_path)
|
35 |
|
|
|
128 |
citation=_CITATION,
|
129 |
)
|
130 |
|
131 |
+
def _split_generators(self, dl_manager: datasets.DownloadManager()):
|
132 |
data_dir = self.config.data_dir + "/dataDic"
|
133 |
#mimic=self.mimic_path
|
134 |
+
data_dir = self.config.data_dir + "/dataDic"
|
135 |
+
path_git = dl_manager.download_and_extract(_URL)
|
136 |
+
path_bench = path_git + "/MIMIC-IV-Data-Pipeline-main"
|
137 |
return [
|
138 |
+
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": data_dir, "benchmark": path_bench}),
|
139 |
]
|
140 |
|
141 |
|
142 |
+
def _generate_examples(self, filepath,benchmark):
|
143 |
+
print_test('hello',benchmark)
|
144 |
with open(filepath, 'rb') as fp:
|
145 |
dataDic = pickle.load(fp)
|
146 |
for hid, data in dataDic.items():
|