Skip to main content

Overview

The Labellerr SDK uses Pydantic schemas to define annotation questions. Use the AnnotationQuestion schema to create type-safe questions for object-based annotations (bounding boxes, polygons, etc.) and classification workflows (dropdowns, radio buttons, etc.).

Required Question Structure

Using AnnotationQuestion Schema

Every question must be defined using the AnnotationQuestion schema with the following fields:
Object-based questions (bounding_box, polygon, polyline, dot) require a color parameter (hex code).Classification questions (dropdown, radio, select, boolean) require options as a list of Option objects.Input questions don’t require either color or options.

Question Types Reference

Object-Based Annotations:
  • QuestionType.bounding_box - Rectangle annotations
  • QuestionType.polygon - Multi-point polygon shapes
  • QuestionType.polyline - Connected line segments
  • QuestionType.dot - Single point markers
Classification Annotations:
  • QuestionType.dropdown - Single selection dropdown
  • QuestionType.radio - Radio button selection
  • QuestionType.select - Multi-select options
  • QuestionType.boolean - Yes/No toggle
  • QuestionType.input - Free text input
Specialized:
  • QuestionType.stt - Speech-to-text
  • QuestionType.imc - Image classification

Examples

Multiple Questions Template

Create a template with multiple question types including object detection and classification:

Single Question Template

Create a simple template with a single annotation question:

Classification Only Template

Create a template with only classification questions (no object detection):

Best Practices

Unique Question IDs

Always generate unique question IDs using str(uuid.uuid4()) to avoid conflicts. Reuse IDs only when intentionally updating an existing question.

Sequential Numbering

Ensure question_number values are sequential (1, 2, 3, …) to maintain proper ordering in the annotation interface.

Color Selection

Use distinct hex colors for different object types to make them easily distinguishable in the annotation interface.

Clear Labels

Write concise, descriptive question text that clearly communicates what annotators should label.

Create Projects

Learn how to create projects using annotation templates