yonatanbitton commited on
Commit
ca64b19
1 Parent(s): f5593f3

Update vasr.py

Browse files
Files changed (1) hide show
  1. vasr.py +6 -28
vasr.py CHANGED
@@ -32,14 +32,8 @@ _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
- _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
-
42
- class Vasr(datasets.GeneratorBasedBuilder):
43
  VERSION = datasets.Version("1.1.0")
44
 
45
  # If you need to make complex sub-parts in the datasets with configurable options
@@ -49,9 +43,7 @@ class Vasr(datasets.GeneratorBasedBuilder):
49
  # You will be able to load one or the other configurations in the following list with
50
  # data = datasets.load_dataset('vasr', 'test')
51
  BUILDER_CONFIGS = [
52
- datasets.BuilderConfig(name="TEST", version=VERSION, description="vasr dataset gold test"),
53
- # datasets.BuilderConfig(name="VALIDATION", version=VERSION, description="vasr dataset gold validation"),
54
- # datasets.BuilderConfig(name="TRAIN", version=VERSION, description="vasr dataset gold train")
55
  ]
56
  IMAGE_EXTENSION = "jpg"
57
 
@@ -92,7 +84,10 @@ class Vasr(datasets.GeneratorBasedBuilder):
92
 
93
  def _split_generators(self, dl_manager):
94
  # If several configurations are possible (listed in BUILDER_CONFIGS), the configuration selected by the user is in self.config.name
95
- # downloaded_files = dl_manager.download_and_extract(_URLS)
 
 
 
96
  data_dir = dl_manager.download_and_extract({
97
  "examples_csv": hf_hub_url("datasets/nlphuji/vasr", filename="test_gold.csv"),
98
  "images_dir": hf_hub_url("datasets/nlphuji/vasr", filename="vasr_images.zip")
@@ -100,23 +95,6 @@ class Vasr(datasets.GeneratorBasedBuilder):
100
 
101
  return [datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs=data_dir)]
102
 
103
- # dl_manager is a datasets.download.DownloadManager that can be used to download and extract URLS
104
- # 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.
105
- # By default the archives will be extracted and a path to a cached folder where they are extracted is returned instead of the archive
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 [datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs=data_dir)]
111
- # return [
112
- # datasets.SplitGenerator(name=datasets.Split.TEST,
113
- # gen_kwargs={**data_dir, **{'filepath': downloaded_files["test"]}}),
114
- # datasets.SplitGenerator(name=datasets.Split.TRAIN,
115
- # gen_kwargs={**data_dir, **{'filepath': downloaded_files["train"]}}),
116
- # datasets.SplitGenerator(name=datasets.Split.VALIDATION,
117
- # gen_kwargs={**data_dir, **{'filepath': downloaded_files["dev"]}}),
118
- # ]
119
-
120
  # method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
121
  def _generate_examples(self, examples_csv, images_dir):
122
  # The `key` is for legacy reasons (tfds) and is not important in itself, but must be unique for each example.
 
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")
38
 
39
  # If you need to make complex sub-parts in the datasets with configurable options
 
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
 
 
84
 
85
  def _split_generators(self, dl_manager):
86
  # If several configurations are possible (listed in BUILDER_CONFIGS), the configuration selected by the user is in self.config.name
87
+
88
+ # dl_manager is a datasets.download.DownloadManager that can be used to download and extract URLS
89
+ # 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.
90
+ # By default the archives will be extracted and a path to a cached folder where they are extracted is returned instead of the archive
91
  data_dir = dl_manager.download_and_extract({
92
  "examples_csv": hf_hub_url("datasets/nlphuji/vasr", filename="test_gold.csv"),
93
  "images_dir": hf_hub_url("datasets/nlphuji/vasr", filename="vasr_images.zip")
 
95
 
96
  return [datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs=data_dir)]
97
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
98
  # method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
99
  def _generate_examples(self, examples_csv, images_dir):
100
  # The `key` is for legacy reasons (tfds) and is not important in itself, but must be unique for each example.