stefanieschneider
commited on
Commit
•
a15ad03
1
Parent(s):
0506030
Add correct versioning
Browse files
artigo.py
CHANGED
@@ -68,7 +68,8 @@ def create_annotations_dict(annotations_file):
|
|
68 |
class ARTigo(datasets.GeneratorBasedBuilder):
|
69 |
"""Dataset of the 'ARTigo: Social Image Tagging' project"""
|
70 |
|
71 |
-
|
|
|
72 |
|
73 |
def _info(self):
|
74 |
features = datasets.Features(
|
@@ -124,16 +125,14 @@ class ARTigo(datasets.GeneratorBasedBuilder):
|
|
124 |
)
|
125 |
|
126 |
def _split_generators(self, dl_manager):
|
127 |
-
zenodo_record = requests.get(_URLS).json()
|
128 |
-
|
129 |
image_urls = [
|
130 |
file["links"]["self"]
|
131 |
-
for file in
|
132 |
if file["type"] == "zip"
|
133 |
]
|
134 |
annotation_urls = [
|
135 |
file["links"]["self"]
|
136 |
-
for file in
|
137 |
if file["type"] == "jsonl"
|
138 |
]
|
139 |
|
@@ -163,6 +162,6 @@ class ARTigo(datasets.GeneratorBasedBuilder):
|
|
163 |
|
164 |
yield image_data["id"], image_data
|
165 |
except Exception:
|
166 |
-
logger.warn(image_file.name)
|
167 |
|
168 |
continue
|
|
|
68 |
class ARTigo(datasets.GeneratorBasedBuilder):
|
69 |
"""Dataset of the 'ARTigo: Social Image Tagging' project"""
|
70 |
|
71 |
+
ZENODO_RECORD = requests.get(_URLS).json()
|
72 |
+
VERSION = datasets.Version(f"{ZENODO_RECORD['metadata']['version']}.0")
|
73 |
|
74 |
def _info(self):
|
75 |
features = datasets.Features(
|
|
|
125 |
)
|
126 |
|
127 |
def _split_generators(self, dl_manager):
|
|
|
|
|
128 |
image_urls = [
|
129 |
file["links"]["self"]
|
130 |
+
for file in self.ZENODO_RECORD['files']
|
131 |
if file["type"] == "zip"
|
132 |
]
|
133 |
annotation_urls = [
|
134 |
file["links"]["self"]
|
135 |
+
for file in self.ZENODO_RECORD['files']
|
136 |
if file["type"] == "jsonl"
|
137 |
]
|
138 |
|
|
|
162 |
|
163 |
yield image_data["id"], image_data
|
164 |
except Exception:
|
165 |
+
logger.warn(Path(image_file).name)
|
166 |
|
167 |
continue
|