load dataset in streaming mode
Browse files- dhivehi-corpus.py +4 -3
dhivehi-corpus.py
CHANGED
@@ -49,7 +49,8 @@ class DhivehiCorpus(datasets.GeneratorBasedBuilder):
|
|
49 |
|
50 |
def _generate_examples(self, filepath, split):
|
51 |
with open(filepath, encoding="utf8") as f:
|
52 |
-
|
53 |
-
for
|
54 |
-
yield id_, {"text":
|
|
|
55 |
|
|
|
49 |
|
50 |
def _generate_examples(self, filepath, split):
|
51 |
with open(filepath, encoding="utf8") as f:
|
52 |
+
id_ = 0
|
53 |
+
for line in f:
|
54 |
+
yield id_, {"text": line.strip()}
|
55 |
+
id_ += 1
|
56 |
|