Update healthcare_facilities_reviews.py
Browse files
healthcare_facilities_reviews.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
import datasets
|
2 |
-
import
|
3 |
|
4 |
class HfreviewsConfig(datasets.BuilderConfig):
|
5 |
def __init__(self, features, **kwargs):
|
@@ -46,11 +46,9 @@ class HealthcareFacilitiesReviews(datasets.GeneratorBasedBuilder):
|
|
46 |
]
|
47 |
|
48 |
def _generate_examples(self, filepath):
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
yield example["Idx"], example
|
|
|
1 |
import datasets
|
2 |
+
import json
|
3 |
|
4 |
class HfreviewsConfig(datasets.BuilderConfig):
|
5 |
def __init__(self, features, **kwargs):
|
|
|
46 |
]
|
47 |
|
48 |
def _generate_examples(self, filepath):
|
49 |
+
"""Yields examples."""
|
50 |
+
with open(filepath, encoding="utf-8") as f:
|
51 |
+
for uid, row in enumerate(f):
|
52 |
+
data = json.loads(row)
|
53 |
+
data["Idx"] = uid
|
54 |
+
yield uid, data
|
|
|
|