๐งชTDD Challengeยทbeginnerยทโฑ๏ธ 25โ40mยทโญ 150 XP
M-014Few-Shot Product Classifier
Description
Nebula Corp's e-commerce platform receives thousands of product listings daily, but they're uncategorized. The current zero-shot classifier is inconsistent โ sometimes 'wireless headphones' goes to Electronics, sometimes to Audio, sometimes to Accessories. Build a few-shot prompt constructor that uses 3 diverse examples to teach the model the exact categorization rules. The examples must cover edge cases and demonstrate the distinction between similar categories.
Test Cases (6)
Lists all categories
The prompt must list all valid categories so the model knows the complete set of options
Input:"Wireless mouse", ["Electronics", "Office", "Accessories"]
Expected:CONTAINS_ALL:Electronics,Office,Accessories
Contains exactly 3 examples
Should have 3 example products plus the target product (4 total 'Product:' occurrences)
Input:"Running shoes", ["Sports", "Clothing", "Footwear"]
Expected:COUNT:Product::4
Examples show diverse categories
Examples should demonstrate different categories, not all from the same one
Input:"Coffee maker", ["Electronics", "Kitchen", "Appliances"]
Expected:CONTAINS_ANY:Electronics,Kitchen,Appliances
Consistent format across examples
Each example and the target should have 'Category:' label (4 total)
Input:"Mystery novel", ["Books", "Entertainment", "Media"]
Expected:COUNT:Category::4
Includes target product
The prompt must include the actual product to classify
Input:"Bluetooth speaker with waterproof design", ["Electronics", "Audio", "Outdoor"]
Expected:CONTAINS:Bluetooth speaker with waterproof design
Ends with completion cue
Should end with 'Category:' for the model to complete
Input:"Garden hose 50ft", ["Home & Garden", "Outdoor", "Tools"]
Expected:ENDS_WITH:Category:
Related Lessons
Click Run / Check to validate your solution