Datasets:
SLPL
/

Modalities:
Text
Languages:
Persian
ArXiv:
Libraries:
Datasets
License:
sadrasabouri commited on
Commit
889963e
1 Parent(s): d2e729b

Update naab.py

Browse files
Files changed (1) hide show
  1. naab.py +5 -6
naab.py CHANGED
@@ -116,11 +116,10 @@ class Naab(datasets.GeneratorBasedBuilder):
116
  ]
117
 
118
  def _generate_examples(self, filepath, split):
119
- # The `key` is for legacy reasons (tfds) and is not important in itself, but must be unique for each example.
120
  with open(filepath, encoding="utf-8") as f:
121
  for key, row in enumerate(f):
122
- data = json.loads(row)
123
- yield key, {
124
- "paragraph": data["paragraph"]
125
- }
126
-
 
116
  ]
117
 
118
  def _generate_examples(self, filepath, split):
119
+
120
  with open(filepath, encoding="utf-8") as f:
121
  for key, row in enumerate(f):
122
+ if row.strip():
123
+ yield idx, {"text": row}
124
+ else:
125
+ yield idx, {"text": ""}