Hierarchical classification
Open in playground →Task
Put a product in a department, then in a category inside that department.
Challenges
departmentchooses from 3 departments. Each department has its own field with its categories, and"when": {"department": ...}runs only the one that matches, so the other two are skipped.- A French press goes to
home_kitchen, thencoffee_tea. A backpacking tent, "Two-person backpacking tent, 4 lb, waterproof rainfly.", came backsports_outdoorsandcamping, and the other two departments were skipped.
Laying out…
Generation(
result={
'department': 'home_kitchen',
'home_kitchen': 'coffee_tea',
},
thinking={},
usage=Usage(input_tokens=218, thinking_tokens=0),
skipped=[
'electronics',
'sports_outdoors',
],
)Build it into a task: Hierarchical classification in one call, in the cookbook.