Hierarchical classification
Classify into a deep taxonomy without asking one question to carry an unwieldy option list.
CHOICE×1
01
HOW IT WORKS
root = Choice(
instructions="Which top-level product area does this document belong to?",
criteria={
"payments": "Charges, payouts, invoices, and refunds.",
"identity": "Login, authentication, and user verification.",
"analytics": "Reports, dashboards, and data exports.",
"other": "No top-level area clearly fits.",
},
)If the chosen branch changes the next options, build a second state/question set in code. If all questions could have been asked against the original state, prefer one fan-out request and let code ignore irrelevant answers. Use an explicit other or review leaf so the taxonomy can admit uncertainty.
Source: Hierarchical classification and when one question depends on another.
1 REQUEST / 1 ANSWER
THIS PATTERN IN ONE LINE