Update alignment.py

This commit is contained in:
awerks
2023-08-17 14:56:54 +02:00
committed by GitHub
parent abbb66b58e
commit 6cb7267dc2

View File

@ -99,7 +99,8 @@ def align(
interpolate_method: str = "nearest",
return_char_alignments: bool = False,
print_progress = False,
combined_progress = False
combined_progress = False,
total_segments = 0
) -> AlignedTranscriptionResult:
"""
Align phoneme recognition predictions to known transcription.
@ -118,9 +119,6 @@ def align(
model_lang = align_model_metadata["language"]
model_type = align_model_metadata["type"]
total_segments = len(list(transcript))
transcript = iter(transcript)
# 1. Preprocess to keep only characters in dictionary
for sdx, segment in enumerate(transcript):
# strip spaces at beginning / end, but keep track of the amount.