Datasets:
Commit
·
e457931
1
Parent(s):
dea11c3
Update afriqa.py
Browse files
afriqa.py
CHANGED
|
@@ -2,7 +2,6 @@
|
|
| 2 |
|
| 3 |
|
| 4 |
import json
|
| 5 |
-
import jsonlines
|
| 6 |
import os
|
| 7 |
from textwrap import dedent
|
| 8 |
|
|
@@ -101,8 +100,9 @@ class AfriQA(datasets.GeneratorBasedBuilder):
|
|
| 101 |
|
| 102 |
def _generate_examples(self, filepath):
|
| 103 |
"""Yields examples."""
|
| 104 |
-
with
|
| 105 |
-
for _,
|
|
|
|
| 106 |
_id = example["id"]
|
| 107 |
|
| 108 |
yield _id, {
|
|
|
|
| 2 |
|
| 3 |
|
| 4 |
import json
|
|
|
|
| 5 |
import os
|
| 6 |
from textwrap import dedent
|
| 7 |
|
|
|
|
| 100 |
|
| 101 |
def _generate_examples(self, filepath):
|
| 102 |
"""Yields examples."""
|
| 103 |
+
with open(filepath, encoding="utf-8-sig") as f:
|
| 104 |
+
for _, row in enumerate(f):
|
| 105 |
+
example = json.loads(row)
|
| 106 |
_id = example["id"]
|
| 107 |
|
| 108 |
yield _id, {
|