コード例 #1
0
ファイル: evaluate.py プロジェクト: vmujadia/sockeye
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)
コード例 #2
0
ファイル: test_rouge.py プロジェクト: hoangcuong2011/sockeye
def test_rouge_1(hypotheses, references, rouge1_score, rouge2_score,
                 rougel_score):
    rouge_score = rouge.rouge_1(hypotheses, references)
    assert rouge_score == rouge1_score