Matīss commited on
Commit
598119f
1 Parent(s): 5ad06b2

Upload liv4ever.py

Browse files
Files changed (1) hide show
  1. liv4ever.py +41 -8
liv4ever.py CHANGED
@@ -179,11 +179,44 @@ class liv4ever(datasets.GeneratorBasedBuilder):
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
- "liv": sentence["liv"],
185
- "en": sentence["en"] if "en" in sentence else "",
186
- "et": sentence["et"] if "et" in sentence else "",
187
- "lv": sentence["lv"] if "lv" in sentence else "",
188
- "fr": sentence["fr"] if "fr" in sentence else "",
189
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
179
  for sentence in source["sentences"]:
180
  # Yields examples as (key, example) tuples
181
  n=n+1
182
+ if source["source"] == "facebook" or source["source"] == "satversme":
183
+ yield n, {
184
+ "source": source["source"],
185
+ "liv": sentence["liv"],
186
+ "lv": sentence["lv"],
187
+ "fr": sentence["fr"],
188
+ "en": sentence["en"],
189
+ }
190
+ if source["source"] == "songs":
191
+ yield n, {
192
+ "source": source["source"],
193
+ "liv": sentence["liv"],
194
+ "lv": sentence["lv"],
195
+ "et": sentence["et"],
196
+ "en": sentence["en"],
197
+ }
198
+ if source["source"] == "trilium" or source["source"] == "dictionary" or source["source"] == "stalte":
199
+ yield n, {
200
+ "source": source["source"],
201
+ "liv": sentence["liv"],
202
+ "lv": sentence["lv"],
203
+ "et": sentence["et"],
204
+ }
205
+ if source["source"] == "vaari" or source["source"] == "luule":
206
+ yield n, {
207
+ "source": source["source"],
208
+ "liv": sentence["liv"],
209
+ "et": sentence["et"],
210
+ }
211
+ if source["source"] == "jeful" and "et" in sentence:
212
+ yield n, {
213
+ "source": source["source"],
214
+ "liv": sentence["liv"],
215
+ "et": sentence["et"],
216
+ }
217
+ if source["source"] == "jeful" and "en" in sentence:
218
+ yield n, {
219
+ "source": source["source"],
220
+ "liv": sentence["liv"],
221
+ "en": sentence["en"],
222
+ }