Datasets:
Commit
•
570b1ab
1
Parent(s):
c3a9536
Update sts22-crosslingual-sts.py
Browse files
sts22-crosslingual-sts.py
CHANGED
@@ -97,14 +97,16 @@ class STS22Task8(datasets.GeneratorBasedBuilder):
|
|
97 |
)
|
98 |
|
99 |
def _split_generators(self, dl_manager):
|
100 |
-
train_urls = [_DOWNLOAD_URL.format(split="train", lang=lang) for lang in self.config.languages if lang in _LANGUAGES_TRAIN]
|
101 |
-
test_urls = [
|
|
|
|
|
102 |
|
103 |
-
train_paths = dl_manager.download_and_extract(train_urls)
|
104 |
test_paths = dl_manager.download_and_extract(test_urls)
|
105 |
|
106 |
return [
|
107 |
-
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"file_paths": train_paths}),
|
108 |
datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"file_paths": test_paths}),
|
109 |
]
|
110 |
|
@@ -114,4 +116,4 @@ class STS22Task8(datasets.GeneratorBasedBuilder):
|
|
114 |
with open(file_path, "r", encoding="utf-8") as f:
|
115 |
for line in f:
|
116 |
yield row_count, json.loads(line)
|
117 |
-
row_count += 1
|
|
|
97 |
)
|
98 |
|
99 |
def _split_generators(self, dl_manager):
|
100 |
+
# train_urls = [_DOWNLOAD_URL.format(split="train", lang=lang) for lang in self.config.languages if lang in _LANGUAGES_TRAIN]
|
101 |
+
test_urls = [
|
102 |
+
_DOWNLOAD_URL.format(split="test", lang=lang) for lang in self.config.languages if lang in _LANGUAGES_TEST
|
103 |
+
]
|
104 |
|
105 |
+
# train_paths = dl_manager.download_and_extract(train_urls)
|
106 |
test_paths = dl_manager.download_and_extract(test_urls)
|
107 |
|
108 |
return [
|
109 |
+
# datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"file_paths": train_paths}),
|
110 |
datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"file_paths": test_paths}),
|
111 |
]
|
112 |
|
|
|
116 |
with open(file_path, "r", encoding="utf-8") as f:
|
117 |
for line in f:
|
118 |
yield row_count, json.loads(line)
|
119 |
+
row_count += 1
|