Datasets:
Tasks:
Text Classification
Modalities:
Text
Sub-tasks:
natural-language-inference
Size:
100K - 1M
Tags:
quality-estimation
License:
Update ik-nlp-22_transqe.py
Browse files- 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,
|
| 111 |
"""Yields examples."""
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 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 |
+
}
|
|
|