def METHOD_NAME(self, model_outputs, top_k=5):
    if top_k > self.model.config.num_labels:
        top_k = self.model.config.num_labels
    if self.framework == "pt":
        probs = model_outputs.logits.softmax(-1)[0]
        scores, ids = probs.topk(top_k)
    elif self.framework == "tf":
        probs = stable_softmax(model_outputs.logits, axis=-1)[0]
        topk = tf.math.top_k(probs, k=top_k)
        scores, ids = topk.values.numpy(), topk.indices.numpy()
    else:
        raise ValueError(f"Unsupported framework: {self.framework}")
    scores = scores.tolist()
    ids = ids.tolist()
    return [{"score": score, "label": self.model.config.id2label[_id]} for score, _id in zip(scores, ids)]