Fix bug in item metadata parsing scripts
Browse files- Amazon-Review-2023.py +5 -3
Amazon-Review-2023.py
CHANGED
@@ -88,9 +88,11 @@ class AmazonReview2023(datasets.GeneratorBasedBuilder):
|
|
88 |
Here we dump it to string to make huggingface datasets easy
|
89 |
to store.
|
90 |
"""
|
91 |
-
if isinstance(self.config, RawMetaAmazonReview2023Config)
|
92 |
-
|
93 |
-
|
|
|
|
|
94 |
except:
|
95 |
continue
|
96 |
else:
|
|
|
88 |
Here we dump it to string to make huggingface datasets easy
|
89 |
to store.
|
90 |
"""
|
91 |
+
if isinstance(self.config, RawMetaAmazonReview2023Config):
|
92 |
+
if 'details' in dp:
|
93 |
+
dp['details'] = json.dumps(dp['details'])
|
94 |
+
if 'price' in dp:
|
95 |
+
dp['price'] = str(dp['price'])
|
96 |
except:
|
97 |
continue
|
98 |
else:
|