Update ESLO.py
Browse files
ESLO.py
CHANGED
@@ -389,16 +389,17 @@ class ESLO(datasets.GeneratorBasedBuilder):
|
|
389 |
for path in transcripts:
|
390 |
transcript_name = os.path.splitext(os.path.basename(path))[0]
|
391 |
audio = self.load_audio(audio_files[transcript_name])
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
"
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
|
|
|
389 |
for path in transcripts:
|
390 |
transcript_name = os.path.splitext(os.path.basename(path))[0]
|
391 |
audio = self.load_audio(audio_files[transcript_name])
|
392 |
+
with open(path, "r") as file:
|
393 |
+
for utterance in self.load_one(file):
|
394 |
+
if not self.config.overlap and utterance.overlap:
|
395 |
+
continue
|
396 |
+
yield f"{transcript_name}_{utterance.start_timestamp}-{utterance.end_timestamp}", {
|
397 |
+
"file": transcript_name,
|
398 |
+
"sentence": utterance.sentence,
|
399 |
+
"start_timestamp": utterance.start_timestamp,
|
400 |
+
"end_timestamp": utterance.end_timestamp,
|
401 |
+
"speaker": utterance.speaker,
|
402 |
+
"overlap": utterance.overlap,
|
403 |
+
"audio": {"path": transcript_name,
|
404 |
+
"array": self._cut_audio(audio, utterance.start_timestamp, utterance.end_timestamp),
|
405 |
+
"sampling_rate": 16000}}
|