Skip to content

Instantly share code, notes, and snippets.

@JessicaWachtel
Created November 28, 2025 16:05
Show Gist options
  • Select an option

  • Save JessicaWachtel/cc7c84c0a644f78d8ac6c12d0e0e6a17 to your computer and use it in GitHub Desktop.

Select an option

Save JessicaWachtel/cc7c84c0a644f78d8ac6c12d0e0e6a17 to your computer and use it in GitHub Desktop.
classifier = pipeline("zero-shot-classification")
text_to_classify = "I love my new blender! It makes smoothies so smooth."
candidate_labels = ["electronics", "kitchen appliance", "sports equipment", "furniture"]
result3 = classifier(text_to_classify, candidate_labels)
print(result3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment