Skip to content

Conversation

@TomSteer1
Copy link
Contributor

The calculation for the CER in Chapter 5 does not take into account the spaces, unlike the implementation in the evaluate library or other implementations.

>>> from evaluate import load
>>> cer_metric = load("cer")
>>> reference = "the cat sat on the mat"
>>> prediction = "the cat sit on the"
>>> cer_metric.compute(references=[reference],predictions=[prediction])
0.22727272727272727
>>>
>>> from jiwer import cer
>>> reference = "the cat sat on the mat"
>>> prediction = "the cat sit on the"
>>> cer(reference,prediction)
0.22727272727272727

@Deep-unlearning Deep-unlearning self-assigned this Jun 23, 2025
Copy link
Contributor

@Deep-unlearning Deep-unlearning left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the fix!

@Deep-unlearning Deep-unlearning merged commit 6d914cb into huggingface:main Jun 23, 2025
2 checks passed
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants