예제 #1
0
def raw_corpus_rougel(hypotheses: Iterable[str], references: Iterable[str]) -> float:
    """
    Simple wrapper around ROUGE-L implementation.

    :param hypotheses: Hypotheses stream.
    :param references: Reference stream.
    :return: ROUGE-L score as float between 0 and 1.
    """
    return rouge.rouge_l(hypotheses, references)
예제 #2
0
def test_rouge_l(hypotheses, references, rouge1_score, rouge2_score,
                 rougel_score):
    rouge_score = rouge.rouge_l(hypotheses, references)
    assert rouge_score == rougel_score