Datasets:
Tasks:
Text Classification
Modalities:
Text
Formats:
csv
Sub-tasks:
natural-language-inference
Languages:
Indonesian
Size:
10K - 100K
License:
Update idkmrc-nli.py
Browse files- idkmrc-nli.py +8 -9
idkmrc-nli.py
CHANGED
@@ -16,7 +16,7 @@
|
|
16 |
|
17 |
|
18 |
import json
|
19 |
-
|
20 |
import datasets
|
21 |
|
22 |
|
@@ -99,12 +99,11 @@ class IDKMRCNLI(datasets.GeneratorBasedBuilder):
|
|
99 |
|
100 |
def _generate_examples(self, filepath):
|
101 |
"""Yields examples."""
|
102 |
-
|
103 |
-
|
104 |
-
for id_, row in enumerate(
|
105 |
-
row_jsonl = json.loads(row)
|
106 |
yield id_, {
|
107 |
-
"premise":
|
108 |
-
"hypothesis":
|
109 |
-
"label": {"e": "entailment", "n": "neutral", "c": "contradiction"}[
|
110 |
-
}
|
|
|
16 |
|
17 |
|
18 |
import json
|
19 |
+
import csv
|
20 |
import datasets
|
21 |
|
22 |
|
|
|
99 |
|
100 |
def _generate_examples(self, filepath):
|
101 |
"""Yields examples."""
|
102 |
+
with open(filepath, encoding="utf-8") as csv_file:
|
103 |
+
csv_reader = csv.DictReader(csv_file)
|
104 |
+
for id_, row in enumerate(csv_reader):
|
|
|
105 |
yield id_, {
|
106 |
+
"premise": row["premise"],
|
107 |
+
"hypothesis": row["hypothesis"],
|
108 |
+
"label": {"e": "entailment", "n": "neutral", "c": "contradiction"}[row["label"]],
|
109 |
+
}
|