Jiwer is a simple and fast Python package designed to evaluate Automatic Speech Recognition (ASR) systems. It computes similarity measures such as Word Error Rate (WER), Match Error Rate (MER), Word Information Lost (WIL), Word Information Preserved (WIP), and Character Error Rate (CER). It uses RapidFuzz, which leverages C++ under the hood, for efficient minimum-edit distance calculations, making it faster than pure Python implementations. The current version is 4.0.0, released in June 2025, and it maintains an active development and release cadence.
pip install jiwerVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to calculate the Word Error Rate (WER) for both single and multiple reference/hypothesis pairs using `jiwer.wer()`. It also shows how to use `jiwer.process_words()` to obtain a more detailed output, including various error measures and the alignment between the reference and hypothesis.
Update calls from `jiwer.compute_measures()` to `jiwer.process_words()` and `jiwer.visualize_measures()` to `jiwer.visualize_alignment()`. Adjust code to access results from the returned `WordOutput` or `CharacterOutput` dataclass attributes (e.g., `output.wer`) instead of dictionary keys.
Review existing code that processes empty or potentially empty reference/hypothesis pairs. The new behavior is generally safer, but ensure it aligns with your specific evaluation logic.
If you are directly inspecting or parsing the `alignments` output from `process_words()` or `process_characters()`, update your code to access attributes of the `AlignmentChunk` dataclass (e.g., `chunk.type`, `chunk.ref_start_idx`) instead of tuple indices.
Understand that WER > 1.0 is an expected and valid outcome, indicating poor ASR performance with many extraneous words. Do not cap the WER at 1.0 in your reporting or analysis unless specifically required by a particular standard.
If sentence-by-sentence error rates are needed, you must iterate through your sentence pairs and call `jiwer.wer()` (or `jiwer.cer()`) for each pair individually, or use `jiwer.process_words()`/`process_characters()` and then access the `.wer` or `.cer` attribute of the returned object for each item in the results list.
Utilize `jiwer.Compose()` with transformation functions like `jiwer.ToLowerCase()`, `jiwer.RemovePunctuation()`, `jiwer.ExpandCommonEnglishContractions()`, etc., to build a preprocessing pipeline. Apply this pipeline to your reference and hypothesis texts before computing error rates.
Run `pip install jiwer` in your terminal to install the library.
Either import the specific function directly (e.g., `from jiwer import cer`) or use `jiwer.process_characters()` and access the `cer` attribute from the returned object (e.g., `output = jiwer.process_characters(ref, hyp); error = output.cer`).
Use `jiwer.process_words()` or `jiwer.process_characters()` instead, which return an object containing all individual metrics like `wer`, `mer`, `wil`, `wip`, and `cer`.
Apply consistent text normalization steps (such as converting to lowercase, removing punctuation, and standardizing numbers) to both the reference and hypothesis strings before passing them to `jiwer` functions like `wer()` or `cer()`.