Takes gold and predicted answer sets and first finds a greedy 1-1 alignment
    between them and gets maximum metric values over all the answers

def _align_bags(predicted: List[Set[str]], gold: List[Set[str]]) -> List[float]:
    """
    Takes gold and predicted answer sets and first finds a greedy 1-1 alignment
    between them and gets maximum metric values over all the answers
    """
    f1_scores = []
    for gold_index, gold_item in enumerate(gold):
        max_f1 = 0.0
        max_index = None
        best_alignment: Tuple[Set[str], Set[str]] = (set(), set())
        if predicted:
            for pred_index, pred_item in enumerate(predicted):
                current_f1 = _compute_f1(pred_item, gold_item)
                if current_f1 >= max_f1:
                    best_alignment = (gold_item, pred_item)
                    max_f1 = current_f1
                    max_index = pred_index
            match_flag = _match_numbers_if_present(*best_alignment)
            gold[gold_index] = set()
            predicted[max_index] = set()
        else:
            match_flag = False
        if match_flag:
            f1_scores.append(max_f1)
        else:
            f1_scores.append(0.0)
    return f1_scores