0

I am using TensorFlow for my DNN model, it's a text-classification model which answers user's questions. I want it to print confidence percentage or something like that, and for example if model's confidence is below 80% or so, I want it to print something like "Sorry, I don't know how to answer your question".

I tried looking for something about confidence, but can't really find anything for text-classification model.

Niko
  • 3
  • 2

1 Answers1

0

Possible duplicate of How to calculate confidence score of a Neural Network prediction
It depends of your model. If you have a softmax value it is your answer.

Cross entropy could be adapted for text : Pytorch crossentropy

Tendocat
  • 49
  • 3
  • saw that too, but thought it's for Keras model, but predict() thing worked for me, thanks! – Niko Mar 16 '23 at 19:10