Skip to content

rouge L计算 #7

@FutureWithoutEnding

Description

@FutureWithoutEnding
def rouge_l_corpus(peers, models):
    curpus_size = len(peers)
    rouge_score = 0
    for (peer, model) in zip(peers, models):
        rouge_score += rouge_l(peer, model)
    return rouge_score / curpus_size

rouge_l_corpus 传入rouge_l的是单个的参考摘要(model),但是rouge_l却当作多个参考摘要使用?

def rouge_l(peer, models):
    """
    Compute the ROUGE-L score of a peer with respect to one or more models.
    """
    matches = 0
    recall_total = 0
    for model in models:
        matches += lcs(model, peer)
        recall_total += len(model)
    precision_total = len(models) * len(peer)
    return _safe_f1(matches, recall_total, precision_total)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions