def raw_corpus_rouge1(hypotheses: Iterable[str], references: Iterable[str]) -> float: """ Simple wrapper around ROUGE-1 implementation. :param hypotheses: Hypotheses stream. :param references: Reference stream. :return: ROUGE-1 score as float between 0 and 1. """ return rouge.rouge_1(hypotheses, references)
def test_rouge_1(hypotheses, references, rouge1_score, rouge2_score, rougel_score): rouge_score = rouge.rouge_1(hypotheses, references) assert rouge_score == rouge1_score