Datasets:
Tasks:
Text Classification
Modalities:
Text
Formats:
csv
Sub-tasks:
natural-language-inference
Languages:
Indonesian
Size:
100K - 1M
License:
muhammadravi251001
commited on
Update squadid-nli.py
Browse files- squadid-nli.py +7 -8
squadid-nli.py
CHANGED
@@ -16,7 +16,7 @@
|
|
16 |
|
17 |
|
18 |
import json
|
19 |
-
|
20 |
import datasets
|
21 |
|
22 |
|
@@ -99,12 +99,11 @@ class SQuADIDNLI(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":
|
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": row["label"]
|
109 |
}
|