Datasets:
License:
Matīss
commited on
Commit
•
82198f1
1
Parent(s):
d05218a
Upload liv4ever.py
Browse files- 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
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
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 |
+
}
|