Zero-Shot Text Classification in 5 Lines of Code

M. Haroon Shakeel
1 min readAug 23, 2020

--

Hello World!
Transformers have revolutionized Natural Language Processing (NLP) and at that, huggingfaces has made it really easy to use them for numerous NLP tasks. Recently, huggingfaces has made available a “zero-shot-classification” pipeline that let’s you perform text categorization, sentiment classification, or topic modeling without requiring any labeled data or training.

All you need to do is:
1. Import pipeline
2. Define input text and candidate labels
3. Run the pipeline.

Libraries Required:
1. TesorFlow 2.3.0
2. Torch 1.6.0
3. Transformers 3.0.2

More details at:

--

--

M. Haroon Shakeel
M. Haroon Shakeel

Written by M. Haroon Shakeel

I am PhD scholar, specializing in deep learning for natural language processing and computer vision, specifically interested in learning with minimal data.

No responses yet