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

variable number of gold annotations #69

Closed
danyaljj opened this issue Mar 30, 2020 · 1 comment
Closed

variable number of gold annotations #69

danyaljj opened this issue Mar 30, 2020 · 1 comment

Comments

@danyaljj
Copy link

The example in the introduction assumes that there is a fixed # of gold annotations for each generated text:

import sacrebleu
refs = [['The dog bit the man.', 'It was not unexpected.', 'The man bit him first.'],
        ['The dog had bit the man.', 'No one was surprised.', 'The man had bitten the dog.']]
sys = ['The dog bit the man.', "It wasn't surprising.", 'The man had just bitten him.']
bleu = sacrebleu.corpus_bleu(sys, refs)
print(bleu.score)

Is there a call that accepts variable number of gold text for each generated text?

@martinpopel
Copy link
Collaborator

Yes, it is expected that each reference (gold) translation is available for all sentences. If this is not the case, and e.g. a third reference is missing for some sentences, you can fill the missing blanks with another reference (duplicating a reference should have no effect on BLEU):

refs = [['The dog bit the man.', 'It was not unexpected.', 'The man bit him first.'],
        ['The dog had bit the man.', 'No one was surprised.', 'The man had bitten the dog.'],
        ['This is the 3rd reference, which is available only for the first sentence.', 'No one was surprised.', 'The man had bitten the dog.'],]

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

3 participants