Skip to content

Commit

Permalink
Fix alignment doc in usage.md
Browse files Browse the repository at this point in the history
  • Loading branch information
nikvaessen committed Sep 4, 2023
1 parent cc6cfb3 commit 7dfd008
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:

Expand Down

0 comments on commit 7dfd008

Please sign in to comment.