Hello,
I finetuned a BertforSequenceClassification model in order to perform a multiclass classification. However, when my model is finetuned I predict my test dataset with:
preds_output = trainer.predict(data_encoded['test'])
So I am able to get my predicted output with:
preds_output.predictions
This should return 2 arrays. One including the logits and another including the predicted classes. Now I want to get the probabilty the classes are predicted with instead of the logits. When I try to do that with
from torch import nn
probabilities = nn.functional.softmax(preds_output.predictions, dim=-1)
print(probabilities)
I get the error that ‘numpy.ndarray’ object has no attribute ‘softmax’. Any idea what can help? Thank you guys