Match vector confidences with intents labels

Hello all!

I wanted to know if anyone can help me with this:

I would like to take the raw data before applying the softmax, and the confidence intent scores, to work apart with these data.

These are probably stupid questions but I can’t answer them on my own.

I wanted to know if is correct that the information that I am looking for is available in confidences=tf.nn.softmax(similarities) and similarities, respectively.

To see this information this information put a tf.print(confidences) and a tf.print(similarities) in “layers.py” file.

I would like to know what entry of the confidence vector corresponds with each intent considered. I looked “predictions” in “model_testing.py” but I’m not sure how to look at this.

Now I’ve seen that maybe what I’m looking for is index_label_id_mapping which is in “diet_classifier.py” (I’m currently using this classifier for training)…

I appreciate any attempt to help me and correct my errors.

When searching for a matching intent, Dialogflow scores potential matches with an intent detection confidence, also known as the confidence score. MyFloridaAccess

Thanks for your reply! I understand that it is also possible in Rasa to access the list of intent_rankings that show the classification of the model according to the probability predictions. But I would like to get the raw data before the application of softmax…

For example, if I have the message : “cu” with intent label “goodbye”, and index_label_id_mapping : {0: ‘affirm’, 1: ‘deny’, 2: ‘goodbye’, 3: ‘greet’, 4: ‘mood_great’, 5: ‘mood_unhappy’}

confidences: [[0.310821891 0.254208207 0.297648519 0.0415470637 0.0364398137 0.0593344681]]

similarities: [[0.741547525 0.540481091 0.698240817 -1.27084577 -1.40201056 -0.914482236]]

Assuming I don’t use the fallback classifier, is correct to say that the predicted intent is “affirm” since tf.argmax(confidences)=0, and therefore index_label_id_mapping[0]: “affirm”, and similarity for “affirm” is 0.74 Then, the similarity for “deny” is 0.54, and the confidence is 0.25, similarity for “goodbye” is 0.59, and confidence is 0.29, and so on??