diff --git a/docs/usage.md b/docs/usage.md index 738d77f..4cdfc4f 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -23,7 +23,7 @@ wer = jiwer.wer(reference, hypothesis) mer = jiwer.mer(reference, hypothesis) wil = jiwer.wil(reference, hypothesis) -# faster, because `compute_measures` only needs to perform the heavy lifting once: +# faster, because `process_words` only needs to perform the heavy lifting once: output = jiwer.process_words(reference, hypothesis) wer = output.wer mer = output.mer @@ -58,10 +58,9 @@ error = output.cer # Alignment -With `jiwer.process_words`, you also get the alignment between the reference and hypothesis. +With `jiwer.process_words` and `jiwer.process_characters`, you get the alignment between the reference and hypothesis. -We provide the alignment as a list of `(op, ref_start_idx, ref_idx_end, hyp_idx_start, hyp_idx_end)`, where `op` is one of - `equal`, `replace`, `delete`, or `insert`. +We provide the alignment as a list of `AlignmentChunk` objects with attributes `type, ref_start_idx, ref_end_idx, hyp_start_idx, hyp_end_idx`, where `type` is one of `equal`, `substitute`, `delete`, or `insert`. This looks like the following: