-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LayoutLM prediction with confidence score? #402
Comments
I think I get the result. Correct me if I'm wrong. From that output, I can extract that there are 14 type of labels and the most likely one is number 13 with 0.992790937423706 (99.2%). But that is not quite what I was aming for. I'm not looking for the probability of each label for that prediction. I'm looking for the prediction score itself. Something like this prediction has a confidence of 75% |
nk-alex
changed the title
LayoutLM prediction with score?
LayoutLM prediction with confidence score?
Mar 26, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Taking as starting point this notebook more specifically, this function:
I would also like to print the prediction score in % format. I know about
probabilities = torch.nn.functional.softmax(logits, dim=-1)
but I don't quite get how to apply it to obtain the prediction score in % for each element in true_predictions.I tried this way so far:
But this is what I get:
Output: [0.00010619303793646395, 3.339954128023237e-05, 2.2820451704319566e-05, 2.2919863113202155e-05, 0.0005767009570263326, 5.0725124310702085e-05, 3.0033241273486055e-05, 0.006056534126400948, 4.6057226427365094e-05, 1.2512471585068852e-05, 0.0002005402639042586, 2.0308254534029402e-05, 0.992790937423706, 3.023005228897091e-05]
How could I get the percentage format from there?
The text was updated successfully, but these errors were encountered: