Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WER and CER > 1 #4498

Closed
sadrasabouri opened this issue Jun 15, 2022 · 1 comment
Closed

WER and CER > 1 #4498

sadrasabouri opened this issue Jun 15, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@sadrasabouri
Copy link

Describe the bug

It seems that in some cases in which the prediction is longer than the reference we may have word/character error rate higher than 1 which is a bit odd.

If it's a real bug I think I can solve it with a PR changing this line to

return min(incorrect / total, 1.0)

Steps to reproduce the bug

from datasets import load_metric
wer = load_metric("wer")
wer_value = wer.compute(predictions=["Hi World vka"], references=["Hello"])
print(wer_value)

Expected results

1.0

Actual results

3.0

Environment info

  • datasets version: 2.3.0
  • Platform: Linux-5.4.188+-x86_64-with-Ubuntu-18.04-bionic
  • Python version: 3.7.13
  • PyArrow version: 6.0.1
  • Pandas version: 1.3.5
@sadrasabouri sadrasabouri added the bug Something isn't working label Jun 15, 2022
@lhoestq
Copy link
Member

lhoestq commented Jun 15, 2022

WER can have values bigger than 1.0, this is expected when there are too many insertions

From wikipedia:

Note that since N is the number of words in the reference, the word error rate can be larger than 1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants