jiwer
jiwer copied to clipboard
Add option to split alignment output based on maximum character length
This would be useful for looking at alignments of long sentences, e.g.:
out = jiwer.process_words(
"This is a very long sentence that is much longer than the previous one or the one before that",
"This is a very loong sentence that is not much longer than the previous one or one before that",
)
print(jiwer.visualize_alignment(out, max_chars=80))
Would output:
sentence 1
REF: This is a very long sentence that is *** much longer than the previous one
HYP: This is a very loong sentence that is not much longer than the previous one
S I
REF: or the one before that
HYP: or *** one before that
D