Classification with LLMs
Advantages of LLM Classification
Classification Patterns
1. Simple Classification "Classify this email as: spam, important, newsletter, personal"
2. Multi-Label "List all applicable tags: [list of options]"
3. Hierarchical "First classify the category, then the subcategory"
4. With Confidence "Classify and rate your confidence (1-10)"
Prompt Templates
Zero-shot: "Classify the following text into one of these categories: [categories] Text: [text] Category:"
Few-shot: "Examples: Text: 'Great product!' → Positive Text: 'Terrible service' → Negative Text: [new text] →"