What is Zero-Shot Classification?

Zero-shot classification is a fascinating concept in machine learning where a model can classify data into categories it hasn’t seen during training. This is particularly useful in scenarios where labeled data is scarce or unavailable. For example, in natural language processing (NLP), a zero-shot classification model might be trained on general text data but can still classify new text into categories like “sports,” “politics,” or “technology” without having seen examples of these categories during training.

Zero-Shot Classification
Figure 1 - Zero-Shot Classification

Where can you find AI text classificiation models

This is the link to use to filter Hunggingface models for Zero-Shot Classification:

https://huggingface.co/models?pipeline_tag=zero-shot-classification&sort=trending

Our favourite Model Authors:

The most interesting Zero-Shot Classification project

One of the most interesting Zero-Shot Classification projects is called mDeBERTa-v3-base-xnli-multilingual-nli-2mil7.

This multilingual model can perform natural language inference (NLI) on 100 languages and is therefore also suitable for multilingual zero-shot classification. The underlying mDeBERTa-v3-base model was pre-trained by Microsoft on the CC100 multilingual dataset with 100 languages. The model was then fine-tuned on the XNLI dataset and on the multilingual-NLI-26lang-2mil7 dataset. Both datasets contain more than 2.7 million hypothesis-premise pairs in 27 languages spoken by more than 4 billion people.

As of December 2021, mDeBERTa-v3-base is the best performing multilingual base-sized transformer model introduced by Microsoft.

https://huggingface.co/MoritzLaurer/mDeBERTa-v3-base-xnli-multilingual-nli-2mil7

Examples of Zero-Shot Classification:

  • Image classification: A model trained on images of dogs, cats, and horses can recognize and classify images of elephants, giraffes, and lions.
  • Text classification: A model trained on text about sports, politics, and entertainment can classify text about science, history, and culture.
  • Speech recognition: A model trained on speech from different accents and languages can recognize and transcribe speech from new speakers with different accents and languages.

Applications of Zero-Shot Classification:

  1. Robotics: Zero-shot classification can enable robots to recognize and interact with new objects, environments, and situations without requiring extensive retraining.
  2. Natural Language Processing (NLP): Zero-shot classification can improve NLP systems' ability to understand and respond to user queries, even if they are not explicitly trained on those topics.
  3. Computer Vision: Zero-shot classification can enhance computer vision systems ' ability to recognize and classify objects in images and videos, even if they have never seen them before.
  4. Recommendation Systems: Zero-shot classification can improve recommendation systems ' ability to suggest products or services based on users' preferences and behavior, even if they have never been exposed to those items before.

Additional Resources:

How to setup a Zero-Shot Classification LLM on Ubuntu Linux

If you are ready to setup your first Zero-Shot Classification system follow the instructions in our next page:

How to setup a Zero-Shot Classification system

Image sources

Figure 1: https://miro.medium.com/v2/resize:fit:4800/format:webp/1*RDEcS52uXpjfpHYbU_ogSw.jpeg

More information