maximedb commited on
Commit
f3edbd6
·
1 Parent(s): 7e96a0e

Update paws-x-all.py

Browse files
Files changed (1) hide show
  1. paws-x-all.py +7 -1
paws-x-all.py CHANGED
@@ -67,7 +67,8 @@ _DATA_OPTIONS = [
67
  "ja",
68
  "ko",
69
  "zh",
70
- "all"
 
71
  ]
72
 
73
  _DATA_URL = "https://storage.googleapis.com/paws/pawsx/x-final.tar.gz"
@@ -128,6 +129,9 @@ class PAWSX(datasets.GeneratorBasedBuilder):
128
 
129
  data_dir = dl_manager.download_and_extract(_DATA_URL)
130
 
 
 
 
131
  if self.config.name == "all":
132
  _TEST_FILE_NAME = [os.path.join(data_dir, f"x-final/{l}/test_2k.tsv") for l in _LANGUAGES]
133
  _VAL_FILE_NAME = [os.path.join(data_dir, f"x-final/{l}/dev_2k.tsv") for l in _LANGUAGES]
@@ -137,6 +141,8 @@ class PAWSX(datasets.GeneratorBasedBuilder):
137
 
138
  if self.config.name == "en":
139
  _TRAIN_FILE_NAME = [os.path.join(data_dir, f"x-final/{self.config.name}/train.tsv")]
 
 
140
  elif self.config.name == "all":
141
  _TRAIN_FILE_NAME = [os.path.join(data_dir, f"x-final/{l}/translated_train.tsv") for l in _LANGUAGES if l != "en"]
142
  _TRAIN_FILE_NAME += [os.path.join(data_dir, f"x-final/en/train.tsv")]
 
67
  "ja",
68
  "ko",
69
  "zh",
70
+ "all",
71
+ "all_x_en"
72
  ]
73
 
74
  _DATA_URL = "https://storage.googleapis.com/paws/pawsx/x-final.tar.gz"
 
129
 
130
  data_dir = dl_manager.download_and_extract(_DATA_URL)
131
 
132
+ if self.config.name == "all_x_en":
133
+ _TEST_FILE_NAME = [os.path.join(data_dir, f"x-final/{l}/test_2k.tsv") for l in _LANGUAGES if l != "en"]
134
+ _VAL_FILE_NAME = [os.path.join(data_dir, f"x-final/{l}/dev_2k.tsv") for l in _LANGUAGES if l != "en"]
135
  if self.config.name == "all":
136
  _TEST_FILE_NAME = [os.path.join(data_dir, f"x-final/{l}/test_2k.tsv") for l in _LANGUAGES]
137
  _VAL_FILE_NAME = [os.path.join(data_dir, f"x-final/{l}/dev_2k.tsv") for l in _LANGUAGES]
 
141
 
142
  if self.config.name == "en":
143
  _TRAIN_FILE_NAME = [os.path.join(data_dir, f"x-final/{self.config.name}/train.tsv")]
144
+ elif self.config.name == "all_x_en":
145
+ _TRAIN_FILE_NAME = [os.path.join(data_dir, f"x-final/{l}/translated_train.tsv") for l in _LANGUAGES if l != "en"]
146
  elif self.config.name == "all":
147
  _TRAIN_FILE_NAME = [os.path.join(data_dir, f"x-final/{l}/translated_train.tsv") for l in _LANGUAGES if l != "en"]
148
  _TRAIN_FILE_NAME += [os.path.join(data_dir, f"x-final/en/train.tsv")]