You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The example in the introduction assumes that there is a fixed # of gold annotations for each generated text:
importsacrebleurefs= [['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?
The text was updated successfully, but these errors were encountered:
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.'],]
The example in the introduction assumes that there is a fixed # of gold annotations for each generated text:
Is there a call that accepts variable number of gold text for each generated text?
The text was updated successfully, but these errors were encountered: