Update xtd_11.py
Browse files
xtd_11.py
CHANGED
@@ -65,15 +65,12 @@ class XTD_11(datasets.GeneratorBasedBuilder):
|
|
65 |
"""Yields examples."""
|
66 |
# This method needs to handle both single and multiple filepaths
|
67 |
# Adjust the logic based on how you want to load and yield data from your JSON files
|
68 |
-
|
69 |
-
|
|
|
70 |
# Load data from a single file
|
71 |
with open(filepath, encoding="utf-8") as f:
|
72 |
-
for
|
|
|
73 |
yield id, row
|
74 |
-
|
75 |
-
# Example logic for combined split, adjust as needed
|
76 |
-
for fp in filepaths:
|
77 |
-
with open(fp, encoding="utf-8") as f:
|
78 |
-
for id, row in enumerate(json.load(f)):
|
79 |
-
yield id, row
|
|
|
65 |
"""Yields examples."""
|
66 |
# This method needs to handle both single and multiple filepaths
|
67 |
# Adjust the logic based on how you want to load and yield data from your JSON files
|
68 |
+
|
69 |
+
id_ = 0
|
70 |
+
for filepath in filepaths:
|
71 |
# Load data from a single file
|
72 |
with open(filepath, encoding="utf-8") as f:
|
73 |
+
for row in f:
|
74 |
+
data = json.loads(row)
|
75 |
yield id, row
|
76 |
+
id_ +=1
|
|
|
|
|
|
|
|
|
|