def metric_max_over_ground_truths(metric_fn, prediction, ground_truths):
    """
    Calculate the maximum metric value when we have multiple ground truths.
    i.e., for each question, we have multiple answers.
    :param metric_fn: the function to calculate metric
    :param prediction: our model predicted answer string
    :param ground_truths: the list of answer strings
    :return: the maximum metric value by comparing our prediction
             to each ground_truth
    """
    scores_for_ground_truths = []
    for ground_truth in ground_truths:
        score = metric_fn(prediction, ground_truth)
        scores_for_ground_truths.append(score)
    return max(scores_for_ground_truths)