def METHOD_NAME(golden_a_rationales, golden_b_rationales, pred_a_rationales, pred_b_rationales):
    """
    :param golden_dict: dict
    :param pred_dict:   dict
    :return:    macro-f1, micro-f1
    """
    scores = {}
    for id in pred_a_rationales.keys():
        golden_a_ratioanl = golden_a_rationales[id]
        pred_a_rationale = pred_a_rationales[id]
        tp_a = set(golden_a_ratioanl) & set(pred_a_rationale)
        prec_a = len(tp_a) / len(pred_a_rationale) if len(pred_a_rationale) else 0
        rec_a = len(tp_a) / len(golden_a_ratioanl) if len(golden_a_ratioanl) else 0
        f1_a = _f1(prec_a, rec_a)
        golden_b_rationale = golden_b_rationales[id]
        pred_b_rationale = pred_b_rationales[id]
        tp_b = set(golden_b_rationale) & set(pred_b_rationale)
        prec_b = len(tp_b) / len(pred_b_rationale) if len(pred_b_rationale) else 0
        rec_b = len(tp_b) / len(golden_b_rationale) if len(golden_b_rationale) else 0
        f1_b = _f1(prec_b, rec_b)
        scores[id] = {
            "tp_count": (len(tp_a) + len(tp_b)) / 2,
            "pred_count": (len(pred_a_rationale) + len(pred_b_rationale)) / 2,
            "golden_count": (len(golden_a_ratioanl) + len(golden_b_rationale)) / 2,
            "prec": (prec_a + prec_b) / 2,
            "rec": (rec_a + rec_b) / 2,
            "f1": (f1_a + f1_b) / 2,
        }
    macro_f1 = (
        sum(score["f1"] for score in scores.values()) / len(golden_a_rationales) if len(golden_a_rationales) else 0
    )
    return macro_f1, scores