Datasets:

Modalities:
Audio
Text
Formats:
parquet
ArXiv:
Libraries:
Datasets
Dask

Handle_special_character_TED

#8
by Siddhant - opened
Files changed (1) hide show
  1. slue-phase-2.py +10 -2
slue-phase-2.py CHANGED
@@ -435,12 +435,20 @@ class SLUE2(datasets.GeneratorBasedBuilder):
435
  data_dir, split,
436
  row["id"] + ".flac"
437
  )
 
 
 
 
 
 
 
 
438
  example = {
439
  "id": row["id"],
440
  "audio": audio_file,
441
  "speaker": row["speaker"],
442
  "transcript": row["transcript"],
443
- "title": eval(row.get("title", "[]")),
444
- "abstract": eval(row.get("abstract", "[]")),
445
  }
446
  yield idx, example
 
435
  data_dir, split,
436
  row["id"] + ".flac"
437
  )
438
+ if "title" not in row:
439
+ title_str=[]
440
+ else:
441
+ title_str=row["title"]
442
+ if "abstract" not in row:
443
+ abstract_str=[]
444
+ else:
445
+ abstract_str=row["abstract"]
446
  example = {
447
  "id": row["id"],
448
  "audio": audio_file,
449
  "speaker": row["speaker"],
450
  "transcript": row["transcript"],
451
+ "title": title_str,
452
+ "abstract": abstract_str,
453
  }
454
  yield idx, example