jiwer
jiwer copied to clipboard
[CLI] Allow CER calculation with global alignement
Instead of forbidding the -g flag usage when the --cer option is used,
would that make sense to use the cer_contiguous transformation strategy in process_characters instead ?
Something like the following instead of current behavior :
# [...]
if compute_cer:
out = jiwer.process_characters(
reference_sentences,
hypothesis_sentences,
)
if global_alignment:
out = jiwer.process_characters(
reference_sentences,
hypothesis_sentences,
reference_transform=jiwer.cer_contiguous,
hypothesis_transform=jiwer.cer_contiguous,
)
else:
out = jiwer.process_characters(
reference_sentences,
hypothesis_sentences,
)
# [...]