def compute_metrics_from_files(path_to_reference, path_to_candidate, perform_checks=True):
    qids_to_relevant_passageids = load_reference(path_to_reference)
    qids_to_ranked_candidate_passages = load_candidate(path_to_candidate)
    if perform_checks:
        (allowed, message) = quality_checks_qids(qids_to_relevant_passageids, qids_to_ranked_candidate_passages)
        if (message != ''):
            print(message)
    return compute_metrics(qids_to_relevant_passageids, qids_to_ranked_candidate_passages)
def compute_metrics_from_files(path_to_reference, path_to_candidate, perform_checks=True):
    qids_to_relevant_passageids = load_reference(path_to_reference)
    qids_to_ranked_candidate_passages = load_candidate(path_to_candidate)
    if perform_checks:
        (allowed, message) = quality_checks_qids(qids_to_relevant_passageids, qids_to_ranked_candidate_passages)
        if (message != ):
            print(message)
    return compute_metrics(qids_to_relevant_passageids, qids_to_ranked_candidate_passages)