thawani commited on
Commit
8da7f7d
·
1 Parent(s): f2e9330

Update WikiConvert.py

Browse files
Files changed (1) hide show
  1. WikiConvert.py +15 -11
WikiConvert.py CHANGED
@@ -113,14 +113,18 @@ class WikiConvert(datasets.GeneratorBasedBuilder):
113
  logger.info("generating examples from = %s", filepath)
114
  key = 0
115
  with open(filepath, encoding="utf-8") as f:
116
- ds = json.load(f)
117
- for row in ds:
118
- yield key, {
119
- "id": row["id"],
120
- "offset": row["offset"],
121
- "length": row["length"],
122
- "magnitude": row["magnitude"],
123
- "comment": row["comment"],
124
- "number": row["number"],
125
- }
126
- key += 1
 
 
 
 
 
113
  logger.info("generating examples from = %s", filepath)
114
  key = 0
115
  with open(filepath, encoding="utf-8") as f:
116
+ #ds = json.load(f)
117
+ for row in f:
118
+ print(row[:100])
119
+ ds = json.loads(row)
120
+ print(len(ds))
121
+ for row in ds:
122
+ yield key, {
123
+ "id": row["id"],
124
+ "offset": row["offset"],
125
+ "length": row["length"],
126
+ "magnitude": row["magnitude"],
127
+ "comment": row["comment"],
128
+ "number": row["number"],
129
+ }
130
+ key += 1