# Define the evaluation task
def evaluation_task(x: Dict):
    metric = Moderation()
    try:
        metric_score = metric.score(output=x["output"])
        moderation_score = "moderated" if metric_score.value > 0.5 else "not_moderated"
        moderation_reason = metric_score.reason
    except Exception as e:
        print(e)
        moderation_score = None
        moderation_reason = str(e)

    return {
        "moderation_score": moderation_score,
        "moderation_reason": moderation_reason,
    }