gsarti commited on
Commit
8a6366b
·
1 Parent(s): 225f658

Update ik-nlp-22_transqe.py

Browse files
Files changed (1) hide show
  1. ik-nlp-22_transqe.py +27 -28
ik-nlp-22_transqe.py CHANGED
@@ -107,32 +107,31 @@ class IkNlp22ExpNLIConfig(datasets.GeneratorBasedBuilder):
107
  for name, filepath in files.items()
108
  ]
109
 
110
- def _generate_examples(self, files):
111
  """Yields examples."""
112
- for filepath in files:
113
- with open(filepath, encoding="utf-8") as f:
114
- reader = csv.DictReader(f, dialect="tsv")
115
- for i, row in enumerate(reader):
116
- yield i, {
117
- "premise_en": row["premise_en"],
118
- "premise_nl": row["premise_nl"],
119
- "hypothesis_en": row["hypothesis_en"],
120
- "hypothesis_nl": row["hypothesis_nl"],
121
- "label": row["label"],
122
- "explanation_1_en": row["explanation_1_en"],
123
- "explanation_1_nl": row["explanation_1_nl"],
124
- "explanation_2_en": row["explanation_2_en"],
125
- "explanation_2_nl": row["explanation_2_nl"],
126
- "explanation_3_en": row["explanation_3_en"],
127
- "explanation_3_nl": row["explanation_3_nl"],
128
- "da_premise": row["da_premise"],
129
- "mqm_premise": row["mqm_premise"],
130
- "da_hypothesis": row["da_hypothesis"],
131
- "mqm_hypothesis": row["mqm_hypothesis"],
132
- "da_explanation_1": row["da_explanation_1"],
133
- "mqm_explanation_1": row["mqm_explanation_1"],
134
- "da_explanation_2": row["da_explanation_2"],
135
- "mqm_explanation_2": row["mqm_explanation_2"],
136
- "da_explanation_3": row["da_explanation_3"],
137
- "mqm_explanation_3": row["mqm_explanation_3"]
138
- }
 
107
  for name, filepath in files.items()
108
  ]
109
 
110
+ def _generate_examples(self, filepath):
111
  """Yields examples."""
112
+ with open(filepath, encoding="utf-8") as f:
113
+ reader = csv.DictReader(f, dialect="tsv")
114
+ for i, row in enumerate(reader):
115
+ yield i, {
116
+ "premise_en": row["premise_en"],
117
+ "premise_nl": row["premise_nl"],
118
+ "hypothesis_en": row["hypothesis_en"],
119
+ "hypothesis_nl": row["hypothesis_nl"],
120
+ "label": row["label"],
121
+ "explanation_1_en": row["explanation_1_en"],
122
+ "explanation_1_nl": row["explanation_1_nl"],
123
+ "explanation_2_en": row["explanation_2_en"],
124
+ "explanation_2_nl": row["explanation_2_nl"],
125
+ "explanation_3_en": row["explanation_3_en"],
126
+ "explanation_3_nl": row["explanation_3_nl"],
127
+ "da_premise": row["da_premise"],
128
+ "mqm_premise": row["mqm_premise"],
129
+ "da_hypothesis": row["da_hypothesis"],
130
+ "mqm_hypothesis": row["mqm_hypothesis"],
131
+ "da_explanation_1": row["da_explanation_1"],
132
+ "mqm_explanation_1": row["mqm_explanation_1"],
133
+ "da_explanation_2": row["da_explanation_2"],
134
+ "mqm_explanation_2": row["mqm_explanation_2"],
135
+ "da_explanation_3": row["da_explanation_3"],
136
+ "mqm_explanation_3": row["mqm_explanation_3"]
137
+ }