Matīss commited on
Commit
82198f1
1 Parent(s): d05218a

Upload liv4ever.py

Browse files
Files changed (1) hide show
  1. liv4ever.py +9 -8
liv4ever.py CHANGED
@@ -175,11 +175,12 @@ class liv4ever(datasets.GeneratorBasedBuilder):
175
  with open(filepath, encoding="utf-8") as f:
176
  jsondata = json.load(f)
177
  n = 0
178
- for sentence in jsondata:
179
- # Yields examples as (key, example) tuples
180
- n=n+1
181
- yield n, {
182
- "source": sentence["source"],
183
- "en": sentence["en"],
184
- "liv": sentence["liv"],
185
- }
 
 
175
  with open(filepath, encoding="utf-8") as f:
176
  jsondata = json.load(f)
177
  n = 0
178
+ for source in jsondata:
179
+ for sentence in source["sentences"]:
180
+ # Yields examples as (key, example) tuples
181
+ n=n+1
182
+ yield n, {
183
+ "source": source["source"],
184
+ "en": sentence["en"],
185
+ "liv": sentence["liv"],
186
+ }