Datasets:
License:
Upload aftdb.py
Browse files
aftdb.py
CHANGED
@@ -58,7 +58,7 @@ class AFT_Dataset(datasets.GeneratorBasedBuilder):
|
|
58 |
"Dataset containing scientific article figures associated "
|
59 |
"with their caption, summary, and article title."
|
60 |
),
|
61 |
-
data_dir="./{type}",
|
62 |
nb_files_figure=_NB_TAR_FIGURE,
|
63 |
nb_files_table=None
|
64 |
),
|
@@ -70,7 +70,7 @@ class AFT_Dataset(datasets.GeneratorBasedBuilder):
|
|
70 |
"representation of the table, including its caption, summary, "
|
71 |
"and article title."
|
72 |
),
|
73 |
-
data_dir="./{type}",
|
74 |
nb_files_figure=None,
|
75 |
nb_files_table=_NB_TAR_TABLE
|
76 |
),
|
@@ -82,7 +82,7 @@ class AFT_Dataset(datasets.GeneratorBasedBuilder):
|
|
82 |
"textual representation of the table, including its caption, "
|
83 |
"summary, and article title."
|
84 |
),
|
85 |
-
data_dir="./{type}",
|
86 |
nb_files_figure=_NB_TAR_FIGURE,
|
87 |
nb_files_table=_NB_TAR_TABLE
|
88 |
)
|
@@ -135,57 +135,32 @@ class AFT_Dataset(datasets.GeneratorBasedBuilder):
|
|
135 |
data_dir=self.config.data_dir.format(type='table'),
|
136 |
nb_files=self.config.nb_files_table
|
137 |
)
|
138 |
-
dataset = []
|
139 |
if dl_manager.is_streaming:
|
140 |
downloaded_files = dl_manager.download(all_path)
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
for ii in downloaded_files['train']
|
148 |
-
],
|
149 |
-
'is_streaming': dl_manager.is_streaming
|
150 |
-
}
|
151 |
-
)
|
152 |
-
)
|
153 |
-
dataset.append(
|
154 |
-
datasets.SplitGenerator(
|
155 |
-
name=datasets.Split.TEST,
|
156 |
-
gen_kwargs={
|
157 |
-
"filepaths": [
|
158 |
-
dl_manager.iter_archive(ii)
|
159 |
-
for ii in downloaded_files['test']
|
160 |
-
],
|
161 |
-
'is_streaming': dl_manager.is_streaming
|
162 |
-
}
|
163 |
-
)
|
164 |
-
)
|
165 |
else:
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
"filepaths": dl_manager.download_and_extract(
|
182 |
-
all_path['test']
|
183 |
-
),
|
184 |
-
'is_streaming': dl_manager.is_streaming
|
185 |
-
}
|
186 |
-
)
|
187 |
)
|
188 |
-
|
189 |
|
190 |
def _generate_examples(self, filepaths, is_streaming):
|
191 |
if is_streaming:
|
|
|
58 |
"Dataset containing scientific article figures associated "
|
59 |
"with their caption, summary, and article title."
|
60 |
),
|
61 |
+
data_dir="./data/arxiv_dataset/{type}", # A modiféer sur Huggingface Hub
|
62 |
nb_files_figure=_NB_TAR_FIGURE,
|
63 |
nb_files_table=None
|
64 |
),
|
|
|
70 |
"representation of the table, including its caption, summary, "
|
71 |
"and article title."
|
72 |
),
|
73 |
+
data_dir="./data/arxiv_dataset/{type}", # A modiféer sur Huggingface Hub
|
74 |
nb_files_figure=None,
|
75 |
nb_files_table=_NB_TAR_TABLE
|
76 |
),
|
|
|
82 |
"textual representation of the table, including its caption, "
|
83 |
"summary, and article title."
|
84 |
),
|
85 |
+
data_dir="./data/arxiv_dataset/{type}", # A modiféer sur Huggingface Hub
|
86 |
nb_files_figure=_NB_TAR_FIGURE,
|
87 |
nb_files_table=_NB_TAR_TABLE
|
88 |
)
|
|
|
135 |
data_dir=self.config.data_dir.format(type='table'),
|
136 |
nb_files=self.config.nb_files_table
|
137 |
)
|
|
|
138 |
if dl_manager.is_streaming:
|
139 |
downloaded_files = dl_manager.download(all_path)
|
140 |
+
downloaded_files['train'] = [
|
141 |
+
dl_manager.iter_archive(ii) for ii in downloaded_files['train']
|
142 |
+
]
|
143 |
+
downloaded_files['test'] = [
|
144 |
+
dl_manager.iter_archive(ii) for ii in downloaded_files['test']
|
145 |
+
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
146 |
else:
|
147 |
+
downloaded_files = dl_manager.download_and_extract(all_path)
|
148 |
+
return [
|
149 |
+
datasets.SplitGenerator(
|
150 |
+
name=datasets.Split.TRAIN,
|
151 |
+
gen_kwargs={
|
152 |
+
'filepaths': downloaded_files['train'],
|
153 |
+
'is_streaming': dl_manager.is_streaming
|
154 |
+
}
|
155 |
+
),
|
156 |
+
datasets.SplitGenerator(
|
157 |
+
name=datasets.Split.TEST,
|
158 |
+
gen_kwargs={
|
159 |
+
"filepaths": downloaded_files['test'],
|
160 |
+
'is_streaming': dl_manager.is_streaming
|
161 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
162 |
)
|
163 |
+
]
|
164 |
|
165 |
def _generate_examples(self, filepaths, is_streaming):
|
166 |
if is_streaming:
|