-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Add TER (as implemented in sacrebleu) #3153
Conversation
The problem appears to stem from the omission of the lines that you mentioned. If you add them back and try examples from this tutorial (sacrebleu metric example) the code you implemented works fine. I think the purpose of these lines is follows:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @BramVanroy! This already looks nice.
To fix the issues with style, you can run make style
, or mingw32-make style
if you are on Windows.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding this metric :)
It looks all good to me
I just added one line in the docstring for doctest
Implements TER (Translation Edit Rate) as per its implementation in sacrebleu. Sacrebleu for BLEU scores is already implemented in
datasets
so I thought this would be a nice addition.I started from the sacrebleu implementation, as the two metrics have a lot in common.
Verified with sacrebleu's testing suite that this indeed works as intended.