AlhitawiMohammed22
commited on
Commit
β’
61b1e91
1
Parent(s):
828a06e
Update eval_cer.py
Browse files- eval_cer.py +7 -7
eval_cer.py
CHANGED
@@ -55,11 +55,11 @@ _CITATION = """\
|
|
55 |
"""
|
56 |
|
57 |
_DESCRIPTION = """\
|
58 |
-
Character error rate (CER) is a
|
59 |
|
60 |
-
CER is similar to Word Error Rate (WER)
|
61 |
|
62 |
-
|
63 |
|
64 |
CER = (S + D + I) / N = (S + D + I) / (S + D + C)
|
65 |
|
@@ -71,7 +71,7 @@ I is the number of insertions,
|
|
71 |
C is the number of correct characters,
|
72 |
N is the number of characters in the reference (N=S+D+C).
|
73 |
|
74 |
-
CER's output is not always a number between 0 and 1,
|
75 |
performance of the ASR system with a CER of 0 being a perfect score.
|
76 |
"""
|
77 |
|
@@ -79,12 +79,12 @@ _KWARGS_DESCRIPTION = """
|
|
79 |
Computes CER score of transcribed segments against references.
|
80 |
Args:
|
81 |
references: list of references for each speech input.
|
82 |
-
predictions: list of
|
83 |
-
concatenate_texts: Whether or not to concatenate sentences before evaluation, set to True for more accurate result.
|
84 |
Returns:
|
85 |
(float): the character error rate
|
86 |
|
87 |
-
Examples for
|
88 |
>>> # Colab usage
|
89 |
>>> !pip install evaluate jiwer
|
90 |
>>> import evaluate
|
|
|
55 |
"""
|
56 |
|
57 |
_DESCRIPTION = """\
|
58 |
+
Character error rate (CER) is a standard metric of the performance of an automatic speech recognition system.
|
59 |
|
60 |
+
CER is similar to Word Error Rate (WER) but operates on characters instead of words. Please refer to the docs of WER for further information.
|
61 |
|
62 |
+
The character error rate can be computed as:
|
63 |
|
64 |
CER = (S + D + I) / N = (S + D + I) / (S + D + C)
|
65 |
|
|
|
71 |
C is the number of correct characters,
|
72 |
N is the number of characters in the reference (N=S+D+C).
|
73 |
|
74 |
+
CER's output is not always a number between 0 and 1, particularly when there is a high number of insertions. This value is often associated to the percentage of characters that were incorrectly predicted. The lower the value, the better the
|
75 |
performance of the ASR system with a CER of 0 being a perfect score.
|
76 |
"""
|
77 |
|
|
|
79 |
Computes CER score of transcribed segments against references.
|
80 |
Args:
|
81 |
references: list of references for each speech input.
|
82 |
+
predictions: list of transcriptions to score.
|
83 |
+
concatenate_texts: Whether or not to concatenate sentences before evaluation, set to True for a more accurate result.
|
84 |
Returns:
|
85 |
(float): the character error rate
|
86 |
|
87 |
+
Examples for the Hungarian Language:
|
88 |
>>> # Colab usage
|
89 |
>>> !pip install evaluate jiwer
|
90 |
>>> import evaluate
|