PER Calculation
PER Formula
The Punctuation Error Rate (PER) is calculated with the same formula as the WER. It is the count of additions, deletions, and substitutions of punctuation marks divided by the number of punctuation marks in the reference text.
--punctuation_marks sets the marks counted. Unless --no-punctuation_normalization is passed,
hypotheses and references are first normalized by punctuation_normalize in
caiman_eval/src/caiman_eval/text/normalizers.py, which, for example, maps ! to ..
For example:
Hypothesis: Hi dear. Nice to see you, how are you
Reference: Hi, dear! Nice to see you. How are you?
The punctuation error rate is calculated as: $$ PER = \frac{S + D + I}{N} \times 100 = \frac{1 + 2 + 0}{4} \times 100=75\% $$
where S is the number of substitutions, D is the number of deletions,
I is the number of insertions, and N=4 is the number of punctuation marks in the reference text.
Note that in the above example the substitution of . for ! is not counted
due to the punctuation normalization.