Regarding ranking_length parameter in DIET classifier

Hi, I have a question regarding DIET classifier’s parameter “ranking_length” as shown in snapshot: image

I want to know what this parameter represents and how this parameter impacts the performance of the DIET classifier. Thanks in advance.

Hi! First off: this parameter only applies with loss type cross_entropy and softmax confidences. However, cross_entropy is the default loss type, so it will probably apply for you.

ranking_length defines the number of top intents to normalize scores for. This means that when an intent (or entity) is predicted for a message, the top ranking_length (say, the top 10, for example) scores are considered, and used for normalization. All other values are set to 0.

When the value of ranking_length is set to 0, normalization is turned off. If the value of ranking_length is greater than or equal to the number of intents, all scores will be considered.

The value shouldn’t have a noticeable effect on the performance, unless you have very many intents (note: I mean number of intents, like greet or affirm, not number of intent examples, like hello, good morning), in which case larger values of ranking_length might slow down performance. It’s unlikely to have an effect on accuracy, and I’d recommend that you use the default value of 10 unless you have reason to believe another value would be better.

Let me know if any of that was unclear :slight_smile:

Hi Felicia, Thanks a lot for your response. My all the doubts are cleared. Its really helpful.

1 Like

Glad to hear it! :slight_smile:

1 Like