هذه الصفحة غير متوفرة بلغتك بعد. يتم عرض النسخة الإنجليزية.
Hierarchical Multiselect
Build expandable tree-based taxonomy selectors in Potato for hierarchical classification, topic tagging, and multi-level category annotation tasks.
Hierarchical Multiselect
The hierarchical multiselect annotation schema provides an expandable tree interface for selecting categories from a nested taxonomy. This schema is ideal for tasks where labels are organized in a hierarchy, such as topic classification, product categorization, or any multi-level tagging task.
Overview
The hierarchical multiselect schema presents a collapsible tree view where:
- Parent nodes expand to reveal child categories
- Leaf nodes can be selected individually
- Optional auto-selection propagates selections up or down the tree
- Search allows annotators to find categories quickly in large taxonomies
Quick Start
yaml
annotation_schemes:
- annotation_type: hierarchical_multiselect
name: topic_tags
description: Select all applicable topic categories.
taxonomy:
Science:
Physics:
- Quantum Mechanics
- Thermodynamics
Biology:
- Genetics
- Ecology
Technology:
- Software
- HardwareConfiguration Options
| Field | Type | Default | Description |
|---|---|---|---|
annotation_type | string | Required | Must be "hierarchical_multiselect" |
name | string | Required | Unique identifier for this schema |
description | string | Required | Instructions displayed to annotators |
taxonomy | object | Required | Nested object defining the category hierarchy |
auto_select_children | boolean | false | When a parent is selected, automatically select all its children |
auto_select_parent | boolean | false | When all children are selected, automatically select the parent |
show_search | boolean | false | Display a search box to filter the taxonomy tree |
max_selections | integer/null | null | Maximum number of categories that can be selected (null for unlimited) |
expand_depth | integer | 1 | Number of tree levels to expand by default |
label_requirement.required | boolean | false | Whether at least one selection is required before submitting |
Examples
Topic Classification
yaml
annotation_schemes:
- annotation_type: hierarchical_multiselect
name: topic_classification
description: Select all topics that apply to this document.
show_search: true
max_selections: 5
taxonomy:
Politics:
Domestic:
- Elections
- Legislation
- Policy
International:
- Diplomacy
- Trade
- Conflict
Sports:
- Football
- Basketball
- Tennis
Entertainment:
Film:
- Reviews
- Industry News
Music:
- Reviews
- ConcertsProduct Categorization with Auto-Selection
yaml
annotation_schemes:
- annotation_type: hierarchical_multiselect
name: product_category
description: Categorize this product listing.
auto_select_children: true
auto_select_parent: true
expand_depth: 2
taxonomy:
Electronics:
Computers:
- Laptops
- Desktops
- Tablets
Audio:
- Headphones
- Speakers
Clothing:
Men:
- Shirts
- Pants
Women:
- Dresses
- TopsMedical Coding
yaml
annotation_schemes:
- annotation_type: hierarchical_multiselect
name: diagnosis_codes
description: Select all applicable diagnosis categories.
show_search: true
label_requirement:
required: true
taxonomy:
Cardiovascular:
Hypertension:
- Primary
- Secondary
Arrhythmia:
- Atrial Fibrillation
- Ventricular Tachycardia
Respiratory:
Obstructive:
- Asthma
- COPD
Infectious:
- Pneumonia
- BronchitisOutput Format
json
{
"topic_tags": {
"labels": ["Science > Physics > Quantum Mechanics", "Technology > Software"]
}
}Selected categories are stored as full path strings from root to leaf.
Best Practices
- Keep taxonomies manageable - avoid more than 4 levels of nesting; deep trees are hard to navigate
- Enable search for large taxonomies - when there are more than 30 categories,
show_search: truegreatly improves usability - Use auto-selection carefully - auto-selecting children is useful when parent categories imply all children, but can be confusing otherwise
- Set appropriate expand depth - expand enough levels so annotators can see the structure without being overwhelmed
- Limit selections when appropriate - use
max_selectionsto prevent annotators from over-tagging
Further Reading
- Radio & Multiselect - Flat label selection
- Select Dropdown - Single-select dropdown
- Quality Control - Attention checks and gold standards
For implementation details, see the source documentation.