Zero-Shot Intent Classification via HuggingFace🤗

Currently everyone is trying to work out how to use LLM implementations in Conversational AI Frameworks…but there are other options with very similar functionality for this specific use-case.

🤗 Zero-Shot Intent Classification

A single user sentence is submitted:

"I want to close my savings account"
'Accounts', 'Savings', 'Cheque', 'Credit Card', 'Mortgage', 'Close', 'Open'
pip install transformers

from transformers import pipeline
classifier = pipeline("zero-shot-classification",

sequence_to_classify = "I want to close my savings account"
candidate_labels = ['Accounts', 'Savings', 'Cheque', 'Credit Card', 'Mortgage', 'Close', 'Open']
classifier(sequence_to_classify, candidate_labels)
{'sequence': 'I want to close my savings account',
'labels': ['Savings',
'Credit Card'],
'scores': [0.5641598701477051,

In Closing, My Objections To This Approach Are:

How is the initial list of intent labels defined in the first place?



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Cobus Greyling

Chief Evangelist @ HumanFirst. I explore and write about all things at the intersection of AI and language; NLP/NLU/LLM, Chat/Voicebots, CCAI.