Skip inputs with empty clean transcripts

Fix #22
This commit is contained in:
Ryan Hileman 2020-01-31 07:12:16 -08:00 коммит произвёл GitHub
Родитель a5f2808853
Коммит 86779514ec
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 3 добавлений и 0 удалений

Просмотреть файл

@ -563,6 +563,9 @@ def main():
deepspeech_path = None
if kenlm_path and deepspeech_path and not args.stt_no_own_lm:
tc = read_script(script)
if not tc.clean_text.strip():
logging.error('Cleaned transcript is empty for {}'.format(path.basename(script)))
continue
clean_text_path = script + '.clean'
with open(clean_text_path, 'w') as clean_text_file:
clean_text_file.write(tc.clean_text)