def METHOD_NAME(p):
    preds = p.predictions[0] if isinstance(p.predictions, tuple) else p.predictions
    preds = paddle.to_tensor(preds)
    label = paddle.to_tensor(p.label_ids)
    metric = Accuracy()
    metric.reset()
    result = metric.compute(preds, label)
    metric.update(result)
    accu = metric.accumulate()
    metric.reset()
    return {"accuracy": accu}