You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
JiWER is a simple and fast python package to evaluate an automatic speech recognition system.
It supports the following measures:
word error rate (WER)
match error rate (MER)
word information lost (WIL)
word information preserved (WIP)
character error rate (CER)
These measures are computed with the use of the minimum-edit distance between one or more reference and hypothesis sentences.
The minimum-edit distance is calculated using RapidFuzz, which uses C++ under the hood, and is therefore faster than a pure python implementation.
There is undefined behaviour when you apply an empty reference and hypothesis pair
to the WER formula, as you get a division by zero.
As of version 4.0, jiwer defines the behaviour as follows, and thereby also
lifts the requirement for reference strings to be non-empty.
This allows for testing whether models hallucinate on silent audio.
Note that usually, there are multiple reference and hypothesis pairs.
It now supported that one or more of these references are empty, but to test well,
most references should still be non-empty.
importjiwer# when ref and hyp are both empty, there is no error as# an ASR system correctly predicted silence/non-speech.assertjiwer.wer('', '') ==0assertjiwer.mer('', '') ==0assertjiwer.wip('', '') ==1assertjiwer.wil('', '') ==0assertjiwer.cer('', '') ==0
When the hypothesis is non-empty, every word or character counts as an insertion: