Commit
·
3484aca
1
Parent(s):
a679392
add raw data option
Browse files- AmericanStories.py +2 -1
AmericanStories.py
CHANGED
|
@@ -206,12 +206,13 @@ class AmericanStories(datasets.GeneratorBasedBuilder):
|
|
| 206 |
"article": article["article"],
|
| 207 |
}
|
| 208 |
else:
|
|
|
|
| 209 |
for filepath in os.listdir(year_dir):
|
| 210 |
with open(os.path.join(year_dir, filepath), encoding="utf-8") as f:
|
| 211 |
try :
|
| 212 |
data = json.load(f)
|
| 213 |
except:
|
| 214 |
-
print("Error loading file: " + filepath)
|
| 215 |
continue
|
| 216 |
###Convert json to strng
|
| 217 |
data=json.dumps(data)
|
|
|
|
| 206 |
"article": article["article"],
|
| 207 |
}
|
| 208 |
else:
|
| 209 |
+
print("Returning a json as a string, feel free to parse it yourself!")
|
| 210 |
for filepath in os.listdir(year_dir):
|
| 211 |
with open(os.path.join(year_dir, filepath), encoding="utf-8") as f:
|
| 212 |
try :
|
| 213 |
data = json.load(f)
|
| 214 |
except:
|
| 215 |
+
# print("Error loading file: " + filepath)
|
| 216 |
continue
|
| 217 |
###Convert json to strng
|
| 218 |
data=json.dumps(data)
|