Thanks @Caruso for answering.
It works but there is a blind spot in my understanding which I am able to catch slightly but I want to clear it up more.
Suppose model will predict the following probabilities - 0.14, 1.2, -0.3
how the index’s are mapped with the labels, like how do we know that the first index is mapping to the first label and similarly the other indexes too