sileod commited on
Commit
47d4691
·
1 Parent(s): 4a802a0

Update xnli.py

Browse files
Files changed (1) hide show
  1. xnli.py +9 -38
xnli.py CHANGED
@@ -86,36 +86,16 @@ class Xnli(datasets.GeneratorBasedBuilder):
86
  description=f"Plain text import of XNLI for the {lang} language",
87
  )
88
  for lang in _LANGUAGES
89
- ] + [
90
- XnliConfig(
91
- name="all_languages",
92
- language="all_languages",
93
- version=datasets.Version("1.1.0", ""),
94
- description="Plain text import of XNLI for all languages",
95
- )
96
- ]
97
-
98
  def _info(self):
99
- if self.config.language == "all_languages":
100
- features = datasets.Features(
101
- {
102
- "premise": datasets.Translation(
103
- languages=_LANGUAGES,
104
- ),
105
- "hypothesis": datasets.TranslationVariableLanguages(
106
- languages=_LANGUAGES,
107
- ),
108
- "label": datasets.ClassLabel(names=["entailment", "neutral", "contradiction"]),
109
- }
110
- )
111
- else:
112
- features = datasets.Features(
113
- {
114
- "premise": datasets.Value("string"),
115
- "hypothesis": datasets.Value("string"),
116
- "label": datasets.ClassLabel(names=["entailment", "neutral", "contradiction"]),
117
- }
118
- )
119
  return datasets.DatasetInfo(
120
  description=_DESCRIPTION,
121
  features=features,
@@ -136,15 +116,6 @@ class Xnli(datasets.GeneratorBasedBuilder):
136
  train_dir = os.path.join(dl_dirs["train_data"], "XNLI-MT-1.0", "multinli")
137
  testval_dir = os.path.join(dl_dirs["testval_data"], "XNLI-1.0")
138
  return [
139
- datasets.SplitGenerator(
140
- name=datasets.Split.TRAIN,
141
- gen_kwargs={
142
- "filepaths": [
143
- os.path.join(train_dir, f"multinli.train.{lang}.tsv") for lang in self.config.languages
144
- ],
145
- "data_format": "XNLI-MT",
146
- },
147
- ),
148
  datasets.SplitGenerator(
149
  name=datasets.Split.TEST,
150
  gen_kwargs={"filepaths": [os.path.join(testval_dir, "xnli.test.tsv")], "data_format": "XNLI"},
 
86
  description=f"Plain text import of XNLI for the {lang} language",
87
  )
88
  for lang in _LANGUAGES
89
+ ]
 
 
 
 
 
 
 
 
90
  def _info(self):
91
+
92
+ features = datasets.Features(
93
+ {
94
+ "premise": datasets.Value("string"),
95
+ "hypothesis": datasets.Value("string"),
96
+ "label": datasets.ClassLabel(names=["entailment", "neutral", "contradiction"]),
97
+ }
98
+
 
 
 
 
 
 
 
 
 
 
 
 
99
  return datasets.DatasetInfo(
100
  description=_DESCRIPTION,
101
  features=features,
 
116
  train_dir = os.path.join(dl_dirs["train_data"], "XNLI-MT-1.0", "multinli")
117
  testval_dir = os.path.join(dl_dirs["testval_data"], "XNLI-1.0")
118
  return [
 
 
 
 
 
 
 
 
 
119
  datasets.SplitGenerator(
120
  name=datasets.Split.TEST,
121
  gen_kwargs={"filepaths": [os.path.join(testval_dir, "xnli.test.tsv")], "data_format": "XNLI"},