
Introduction
typically boils down to scenarios where a product review is “positive” or “negative”, or a customer inquiry belongs to one category or another. However, when it comes to human sentiments, the categorization is rarely clean-cut. Even a single sentence can sometimes convey both joy and anger — for instance, “I absolutely love the enhanced battery life, but the new design is incredibly awful.” Enter multi-label classification: an “advanced” classification function capable of assigning multiple categories to data items such as pieces of text at the same time.
enter |
from . from .models... .) .)
, 3) |
MultiLabelZeroShotGPTClassifier
go_emotions
from like , Separate[:100]”) .) [‘text’].) f) f[0]) |
Upload 100 comments. Sample: ‘My favorite food is anything I didn’t have to cook myself.’
It has been loaded 100 . A sample: t be to cook . |
[
“admiration”, “amusement”, “anger”, “annoyance”,
“approval”, “curiosity”, “disappointment”, “joy”,
“sadness”, “surprise”
]
[ “admiration”, “amusement”, “anger”, “annoyance”, “approval”, “curiosity”, “disappointment”, “joy”, “sadness”, “surprise” ] |
[candidate_labels])
.Nothing, [candidate_labels]) |
predictions .) for i in the middle 5): f[i]) f[i]) * ) |
[03:01<00:00, 1.82s/it] [‘amusement’ ‘joy’ ”] [‘anger’ ‘annoyance’ ‘surprise’]
100 100100 [03:01<00:00, 1.82s/it]Comment: Mine food is something I Predicted Emotions: [‘amusement‘ ‘joy‘ ‘‘] s a laugh a screw with in turn of actually dead What is predicted Emotions: [‘anger’ ‘annoyance’ ‘surprise’] ——————— |
fit()
As a next step, you can try to expand the candidate label to better reflect the full range of emotions of your target domain, or switch to a different model hosted by Groq to compare predictive behavior. If you want to go further, scikit-LLM also supports other zero shot and few shot classification techniques – feeding the classifier a few labeled examples can sometimes sharpen its predictions without requiring a full training pipeline. Finally, in production use cases, it is worth building an appropriate test loop to measure label accuracy and recall against a captured annotation sample, to get a physical sense of when the model is performing well and when it is struggling.



