Skip to content

How to get alignment metrics from result? #369

Answered by jianfch
bonsai-byte asked this question in Q&A
Discussion options

You must be logged in to vote

The fail count is not stored in the result but you can recount it. The segment/word is considered as failed if the end-start<=0.
Note that this different from the duration attribute of the segment/word because duration is end-start rounded to 3 decimals.

if fail_segs := len([None for s in result.segments if s.end-s.start <= 0]):

The words that failed to aligned at the end of an audio clip have their end and start set to the audio duration.

# failed segments / total segments
failed_segments = len([None for seg in result.segments if seg.end-seg.start <= 0])
print(f'Failed segments: {failed_segments}/{len(result.segm…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by bonsai-byte
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants