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

Compare event_error_rate and word_error_rate #64

Open
ChristianGeng opened this issue Dec 5, 2024 · 1 comment
Open

Compare event_error_rate and word_error_rate #64

ChristianGeng opened this issue Dec 5, 2024 · 1 comment

Comments

@ChristianGeng
Copy link
Member

ChristianGeng commented Dec 5, 2024

Problem

event_error_rate and word_error_rate can have identical results:

ref = [["hello", "world", "abc"]]
ans = [["hello", "moon"]]

print("eer", audmetric.event_error_rate(ref, ans))
print("wer", audmetric.word_error_rate(ref, and))

results in

eer 0.6666666666666666
wer 0.6666666666666666

When do these two implementations differ, and should this be documented?

Originally posted by @ChristianGeng in #63 (comment)

@ChristianGeng
Copy link
Member Author

ChristianGeng commented Dec 11, 2024

git blame tells me that this was implemented this in summer 2021.
As soon as #63 will have been merged, the issue will persist.

ref = [["hello", "world", "abc"]]
ans = [["hello", "moon"]]

print("eer", audmetric.event_error_rate(ref, ans))
print("wer", audmetric.word_error_rate(ref, ans))
print("eer", audmetric.word_error_rate(ref, ans, norm="longest"))
print("eer", audmetric.word_error_rate(ref, ans, norm="truth"))

looks good

eer 0.6666666666666666
wer 0.6666666666666666
eer 0.6666666666666666
eer 0.6666666666666666

However when trying to use word_eror_rate as a replacement for event_error_rate in its tests:

def test_event_error_rate(truth, prediction, eer):
    np.testing.assert_equal(audmetric.word_error_rate(truth, prediction, norm="longest|truth"), eer)

I get some non passing tests.

So it seems as it is not as trivial as replacing the event_error_rate by word_error_rate and deprecating it.

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

No branches or pull requests

1 participant