Datasets:

Modalities:
Text
Languages:
English
Libraries:
Datasets
License:
asahi417 commited on
Commit
2f7824a
1 Parent(s): a0c348d

fix readme

Browse files
Files changed (1) hide show
  1. analogy_questions.py +6 -10
analogy_questions.py CHANGED
@@ -5,7 +5,7 @@ import datasets
5
  logger = datasets.logging.get_logger(__name__)
6
  _DESCRIPTION = """[Analogy Question](https://aclanthology.org/2021.acl-long.280/)"""
7
  _NAME = "analogy_questions"
8
- _VERSION = "1.0.2"
9
  _CITATION = """
10
  @inproceedings{ushio-etal-2021-bert,
11
  title = "{BERT} is to {NLP} what {A}lex{N}et is to {CV}: Can Pre-Trained Language Models Identify Analogies?",
@@ -80,15 +80,11 @@ class AnalogyQuestion(datasets.GeneratorBasedBuilder):
80
  )
81
 
82
  def _split_generators(self, dl_manager):
83
- if self.config.name == 'sat_full':
84
- downloaded_file = dl_manager.download_and_extract({
85
- str(datasets.Split.TEST): _URLS[str(datasets.Split.TEST)][self.config.name]
86
- })
87
- return [datasets.SplitGenerator(name=str(datasets.Split.TEST),
88
- gen_kwargs={"filepaths": downloaded_file[str(datasets.Split.TEST)]})]
89
- else:
90
- downloaded_file = dl_manager.download_and_extract({k: v[self.config.name] for k, v in _URLS.items()})
91
- return [datasets.SplitGenerator(name=k, gen_kwargs={"filepaths": downloaded_file[k]}) for k in _URLS.keys()]
92
 
93
  def _generate_examples(self, filepaths):
94
  _key = 0
 
5
  logger = datasets.logging.get_logger(__name__)
6
  _DESCRIPTION = """[Analogy Question](https://aclanthology.org/2021.acl-long.280/)"""
7
  _NAME = "analogy_questions"
8
+ _VERSION = "1.0.3"
9
  _CITATION = """
10
  @inproceedings{ushio-etal-2021-bert,
11
  title = "{BERT} is to {NLP} what {A}lex{N}et is to {CV}: Can Pre-Trained Language Models Identify Analogies?",
 
80
  )
81
 
82
  def _split_generators(self, dl_manager):
83
+ target_urls = {k: v[self.config.name] for k, v in _URLS.items() if self.config.name in v}
84
+ downloaded_file = dl_manager.download_and_extract(target_urls)
85
+ return [datasets.SplitGenerator(
86
+ name=k, gen_kwargs={"filepaths": downloaded_file[k]}
87
+ ) for k, v in _URLS.items() if self.config.name in v]
 
 
 
 
88
 
89
  def _generate_examples(self, filepaths):
90
  _key = 0