Having multiple candidate labels in a zero shot classification model
Please be informed, i’m using mDeBERTa-v3-base-mnli-xnli zero shot classification for classifying the label for my input. Its working great, except for not allowing more than 10 candidate labels. I have more than 100 labels. Is it possible that this model could allow it or if not, is there any AI model that can allow this much number of labels. I’m also prepared for going for an inference endpoint if needed.Shall appreciate should you guys provide us with clarity on this issue. Thanks.
2024-05-06T12:34:21Z
Answered that question here:facebook/bart-large-mnli · Number of classes
2024-05-06T13:27:19Z
Thanks for replying, i’m not using transformers locally, but using through serverless inference api. Can we do the same with inference api.
2024-05-08T11:53:34Z
If you’re using the Inference API, you would need to send each (text, candidate label) pair to the API. So this won’t be very efficient, since the serverless inference API does not support batched requests.For production use cases, we recommendInference Endpoints - Hugging Face. You could write acustom handlerwhich takes in a batch of texts + candidate pairs and sends a response (based on the code snippet linked in my reply above).