Handle_special_character_TED (#8)
Browse files- Fix minor error (9bc98ae5e2eeffdb48c4eaec415e3c19d5b5de17)
- 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":
|
444 |
-
"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
|