Forms are easily configured through YAML. Here is a simple form that adds a species dropdown, where the species names are pulled from a column in a CSV file.
form:
- select:
label: 'species'
column: 'common_name'
required: true
items:
path: 'data/categories-small.csv'
value: 'common_name'
Form Structure¶
Forms are assembled from a small set of composable elements, all configured through YAML. Input elements are placed inside a form: list, while structural elements remain at the top level.
Input elements (inside form: list)
select— dropdown menu with inline, file-sourced, or range-based itemstextbox— single-line or multiline text inputcheckbox— boolean toggle with custom checked/unchecked values and optional conditional formsnumber— numeric input with optional min, max, and stepannotation— interactive spectrogram tools (time markers, bounding boxes, multibox)
Top-level elements
title— section header with optional progress trackerpass_value— copy a column from the input row to the outputfixed_value— write a constant value to every output rowsubmission_buttons— configure submit, skip, and previous buttonsdynamic_forms— conditional form sections triggered by select items or checkbox state
Examples¶
Species Labeling with Notes¶
A select dropdown sourced from a CSV file, a required checkbox, and a free-text notes field.
form:
- select:
label: species
column: common_name
required: true
items:
path: data/categories-small.csv
value: common_name
filter_box: true
- checkbox:
label: high quality
column: high_quality
- textbox:
label: notes
column: notesConfidence Rating¶
A simple review form with an inline dropdown and a numeric confidence score.
title:
value: RATE CLIP
progress_tracker: true
form:
- select:
label: quality
column: quality
required: true
items: [good, fair, poor]
- number:
label: confidence
column: confidence
min: 0
max: 1
step: 0.1Time Annotation¶
Collect start and end times by drawing directly on the spectrogram, pre-filled from the source data.
annotation:
start_time:
label: start
column: start_time
source_value: start_time
end_time:
label: end
column: end_time
source_value: end_time
tools: start_end_time_select
form:
- select:
label: species
column: common_name
required: true
items:
path: data/categories-small.csv
value: common_name
submission_buttons:
next:
label: Skip
submit:
label: SubmitDynamic Forms¶
Dynamic forms show different fields depending on the answers to previous responses. Consider the following config:
form:
- select:
label: Is Valid
column: is_valid
required: true
items:
- label: 'yes'
value: 'yes'
form: confirmed_form
- label: 'no'
value: 'no'
form: rejected_form
dynamic_forms:
- confirmed_form:
- select:
label: confidence
column: reviewer_confidence
items: [low, medium, high]
- textbox:
label: notes
column: notes
- rejected_form:
- select:
label: corrected species
column: corrected_common_name
required: true
items:
path: data/categories-small.csv
value: common_name
filter_box: true
custom_value: true
not_available:
label: Unknown Species
value: unknown
- select:
label: rejection reason
column: rejection_reason
required: true
items:
- noise
- wrong species
- overlapping signals
- too faint
- otherA validity dropdown that shows a correction form when “no” is selected and asks for confidence and notes when “yes” is selected. Checkboxes can also trigger dynamic forms using checked_form and unchecked_form:
form:
- checkbox:
label: flag for expert review
column: flagged
checked_form: review_reason_form
dynamic_forms:
- review_reason_form:
- textbox:
label: reason
column: review_reason
