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

Silent failure with incorrect reference format in Python API #220

Open
mdarcy220 opened this issue Oct 25, 2022 · 0 comments
Open

Silent failure with incorrect reference format in Python API #220

mdarcy220 opened this issue Oct 25, 2022 · 0 comments
Labels

Comments

@mdarcy220
Copy link

The docstring for sacrebleu.metrics.BLEU.corpus_score says this:

    :param references: A sequence of reference documents with document being
    defined as a sequence of reference strings. If `None`, cached references
    will be used.

This suggests that for a corpus with N documents and K annotators, references should be a list of N lists of K strings. But in reality the function expects the transpose of that (K lists of N strings).

If you do feed N lists of K strings, the function computes BLEU for the first K documents (albeit with some mismatched reference strings) and silently throws away the rest.

To prevent such misuse, I think it would be good to raise an exception or warning if the lengths of the inner reference lists don't match the length of the hypothesis list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants