def test_degenerate_statistics(statistics, offset, expected_score):
    score = sacrebleu.compute_bleu(statistics[0].common,
                                   statistics[0].total,
                                   statistics[1],
                                   statistics[2],
                                   smooth='floor',
                                   smooth_floor=offset).score / 100
    assert score == expected_score
def test_scoring(statistics, expected_score):
    score = sacrebleu.compute_bleu(statistics[0].common, statistics[0].total,
                                   statistics[1], statistics[2]).score / 100
    assert abs(score - expected_score) < EPSILON
Example #3
0
def test_degenerate_statistics(statistics, offset, expected_score):
    score = sacrebleu.compute_bleu(statistics[0].common, statistics[0].total, statistics[1], statistics[2],
                                   smooth='floor', smooth_floor=offset).score / 100
    assert score == expected_score
Example #4
0
def test_scoring(statistics, expected_score):
    score = sacrebleu.compute_bleu(statistics[0].common, statistics[0].total, statistics[1], statistics[2]).score / 100
    assert abs(score - expected_score) < EPSILON