Felix
commited on
Commit
•
11586d5
1
Parent(s):
ccae210
update supersim tasks
Browse files- superlim-2.py +6 -8
superlim-2.py
CHANGED
@@ -113,8 +113,8 @@ _TASKS = {
|
|
113 |
"absabank-imm": "absabank-imm",
|
114 |
"argumentation_sent":"argumentation-sentences",
|
115 |
"dalaj-ged": "dalaj-ged-superlim",
|
116 |
-
"swesim_relatedness": "supersim-superlim
|
117 |
-
"swesim_similarity": "supersim-superlim
|
118 |
"sweana": "sweanalogy",
|
119 |
"swefaq": "swefaq",
|
120 |
"swepar": "sweparaphrase",
|
@@ -323,10 +323,10 @@ class SuperLim(datasets.GeneratorBasedBuilder):
|
|
323 |
def _split_generators(self, dl_manager):
|
324 |
file_format = 'jsonl'
|
325 |
splits = []
|
326 |
-
|
|
|
327 |
split_test = datasets.SplitGenerator(
|
328 |
name=datasets.Split.TEST,
|
329 |
-
# These kwargs will be passed to _generate_examples
|
330 |
gen_kwargs={
|
331 |
"filepath": data_dir_test,
|
332 |
"split": "test"
|
@@ -334,10 +334,9 @@ class SuperLim(datasets.GeneratorBasedBuilder):
|
|
334 |
)
|
335 |
splits.append(split_test)
|
336 |
if self.config.name in ("absabank-imm", "dalaj-ged", "swefaq", "swewic", "swedn", "swepar"):
|
337 |
-
data_dir_dev = dl_manager.download_and_extract(os.path.join(_URL,
|
338 |
split_dev = datasets.SplitGenerator(
|
339 |
name=datasets.Split.VALIDATION,
|
340 |
-
# These kwargs will be passed to _generate_examples
|
341 |
gen_kwargs={
|
342 |
"filepath": data_dir_dev,
|
343 |
"split": "dev",
|
@@ -345,10 +344,9 @@ class SuperLim(datasets.GeneratorBasedBuilder):
|
|
345 |
)
|
346 |
splits.append(split_dev)
|
347 |
if self.config.name in ("absabank-imm", "dalaj-ged", "swefaq", "swewic", "argumentation_sent", "swedn", "swepar"):
|
348 |
-
data_dir_train = dl_manager.download_and_extract(os.path.join(_URL,
|
349 |
split_train = datasets.SplitGenerator(
|
350 |
name=datasets.Split.TRAIN,
|
351 |
-
# These kwargs will be passed to _generate_examples
|
352 |
gen_kwargs={
|
353 |
"filepath": data_dir_train,
|
354 |
"split": "train",
|
|
|
113 |
"absabank-imm": "absabank-imm",
|
114 |
"argumentation_sent":"argumentation-sentences",
|
115 |
"dalaj-ged": "dalaj-ged-superlim",
|
116 |
+
"swesim_relatedness": "supersim-superlim-relatedness",
|
117 |
+
"swesim_similarity": "supersim-superlim-similarity",
|
118 |
"sweana": "sweanalogy",
|
119 |
"swefaq": "swefaq",
|
120 |
"swepar": "sweparaphrase",
|
|
|
323 |
def _split_generators(self, dl_manager):
|
324 |
file_format = 'jsonl'
|
325 |
splits = []
|
326 |
+
DATA_FOLDER = 'supersim-superlim' if self.config.name.startswith('swesim') else _TASKS[self.config.name]
|
327 |
+
data_dir_test = dl_manager.download_and_extract(os.path.join(_URL,DATA_FOLDER,f"{_TASKS[self.config.name]}_test.{file_format}"))
|
328 |
split_test = datasets.SplitGenerator(
|
329 |
name=datasets.Split.TEST,
|
|
|
330 |
gen_kwargs={
|
331 |
"filepath": data_dir_test,
|
332 |
"split": "test"
|
|
|
334 |
)
|
335 |
splits.append(split_test)
|
336 |
if self.config.name in ("absabank-imm", "dalaj-ged", "swefaq", "swewic", "swedn", "swepar"):
|
337 |
+
data_dir_dev = dl_manager.download_and_extract(os.path.join(_URL,DATA_FOLDER,f"{_TASKS[self.config.name]}_dev.{file_format}"))
|
338 |
split_dev = datasets.SplitGenerator(
|
339 |
name=datasets.Split.VALIDATION,
|
|
|
340 |
gen_kwargs={
|
341 |
"filepath": data_dir_dev,
|
342 |
"split": "dev",
|
|
|
344 |
)
|
345 |
splits.append(split_dev)
|
346 |
if self.config.name in ("absabank-imm", "dalaj-ged", "swefaq", "swewic", "argumentation_sent", "swedn", "swepar"):
|
347 |
+
data_dir_train = dl_manager.download_and_extract(os.path.join(_URL,DATA_FOLDER,f"{_TASKS[self.config.name]}_train.{file_format}"))
|
348 |
split_train = datasets.SplitGenerator(
|
349 |
name=datasets.Split.TRAIN,
|
|
|
350 |
gen_kwargs={
|
351 |
"filepath": data_dir_train,
|
352 |
"split": "train",
|