add translate, fix word_timestamp error

This commit is contained in:
Max Bain
2023-05-13 12:14:06 +01:00
parent 4603f010a5
commit fd8f1003cf
5 changed files with 17 additions and 8 deletions

View File

@ -259,6 +259,10 @@ def align(
word_text = "".join(word_chars["char"].tolist()).strip()
if len(word_text) == 0:
continue
# dont use space character for alignment
word_chars = word_chars[word_chars["char"] != " "]
word_start = word_chars["start"].min()
word_end = word_chars["end"].max()
word_score = round(word_chars["score"].mean(), 3)