Commit
·
bf01044
1
Parent(s):
528e74e
Update vasr.py
Browse files
vasr.py
CHANGED
@@ -32,6 +32,11 @@ _HOMEPAGE = "https://vasr-dataset.github.io/"
|
|
32 |
_LICENSE = "https://creativecommons.org/licenses/by/4.0/"
|
33 |
|
34 |
_URL = "https://huggingface.co/datasets/nlphuji/vasr/blob/main"
|
|
|
|
|
|
|
|
|
|
|
35 |
|
36 |
class Winogavil(datasets.GeneratorBasedBuilder):
|
37 |
VERSION = datasets.Version("1.1.0")
|
@@ -43,7 +48,9 @@ class Winogavil(datasets.GeneratorBasedBuilder):
|
|
43 |
# You will be able to load one or the other configurations in the following list with
|
44 |
# data = datasets.load_dataset('vasr', 'test')
|
45 |
BUILDER_CONFIGS = [
|
46 |
-
datasets.BuilderConfig(name="TEST", version=VERSION, description="vasr dataset"),
|
|
|
|
|
47 |
]
|
48 |
IMAGE_EXTENSION = "jpg"
|
49 |
|
@@ -89,12 +96,25 @@ class Winogavil(datasets.GeneratorBasedBuilder):
|
|
89 |
# dl_manager is a datasets.download.DownloadManager that can be used to download and extract URLS
|
90 |
# It can accept any type or nested list/dict and will give back the same structure with the url replaced with path to local files.
|
91 |
# By default the archives will be extracted and a path to a cached folder where they are extracted is returned instead of the archive
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
data_dir = dl_manager.download_and_extract({
|
93 |
-
"
|
94 |
-
"images_dir": hf_hub_url(repo_id="nlphuji/vasr", repo_type='dataset',filename="vasr_images.zip")
|
95 |
})
|
96 |
|
97 |
-
return [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
98 |
|
99 |
# method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
|
100 |
def _generate_examples(self, examples_csv, images_dir):
|
|
|
32 |
_LICENSE = "https://creativecommons.org/licenses/by/4.0/"
|
33 |
|
34 |
_URL = "https://huggingface.co/datasets/nlphuji/vasr/blob/main"
|
35 |
+
_URLS = {
|
36 |
+
"train": os.path.join(_URL, "train_gold.csv"),
|
37 |
+
"dev": os.path.join(_URL, "dev_gold.csv"),
|
38 |
+
"test": os.path.join(_URL, "test_gold.csv"),
|
39 |
+
}
|
40 |
|
41 |
class Winogavil(datasets.GeneratorBasedBuilder):
|
42 |
VERSION = datasets.Version("1.1.0")
|
|
|
48 |
# You will be able to load one or the other configurations in the following list with
|
49 |
# data = datasets.load_dataset('vasr', 'test')
|
50 |
BUILDER_CONFIGS = [
|
51 |
+
datasets.BuilderConfig(name="TEST", version=VERSION, description="vasr gold test dataset"),
|
52 |
+
datasets.BuilderConfig(name="VALIDATION", version=VERSION, description="vasr gold dev dataset"),
|
53 |
+
datasets.BuilderConfig(name="TRAIN", version=VERSION, description="vasr gold train dataset"),
|
54 |
]
|
55 |
IMAGE_EXTENSION = "jpg"
|
56 |
|
|
|
96 |
# dl_manager is a datasets.download.DownloadManager that can be used to download and extract URLS
|
97 |
# It can accept any type or nested list/dict and will give back the same structure with the url replaced with path to local files.
|
98 |
# By default the archives will be extracted and a path to a cached folder where they are extracted is returned instead of the archive
|
99 |
+
# data_dir = dl_manager.download_and_extract({
|
100 |
+
# "examples_csv": hf_hub_url(repo_id="nlphuji/vasr", repo_type='dataset', filename="test_gold.csv"),
|
101 |
+
# "images_dir": hf_hub_url(repo_id="nlphuji/vasr", repo_type='dataset',filename="vasr_images.zip")
|
102 |
+
# })
|
103 |
+
|
104 |
+
# return [datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs=data_dir)]
|
105 |
+
downloaded_files = dl_manager.download_and_extract(_URLS)
|
106 |
data_dir = dl_manager.download_and_extract({
|
107 |
+
"images_dir": hf_hub_url("datasets/nlphuji/vasr", filename="vasr_images.zip")
|
|
|
108 |
})
|
109 |
|
110 |
+
return [
|
111 |
+
datasets.SplitGenerator(name=datasets.Split.TEST,
|
112 |
+
gen_kwargs={**data_dir, **{'filepath': downloaded_files["test"]}}),
|
113 |
+
datasets.SplitGenerator(name=datasets.Split.TRAIN,
|
114 |
+
gen_kwargs={**data_dir, **{'filepath': downloaded_files["train"]}}),
|
115 |
+
datasets.SplitGenerator(name=datasets.Split.VALIDATION,
|
116 |
+
gen_kwargs={**data_dir, **{'filepath': downloaded_files["dev"]}}),
|
117 |
+
]
|
118 |
|
119 |
# method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
|
120 |
def _generate_examples(self, examples_csv, images_dir):
|