Supported annotations

To import annotations in Labelbox, you need to create the annotations payload. In this section, we provide this payload for every annotation type.

Labelbox support two formats for the annotations payload: Python Annotation types (recommended) and NDJSON. Both are described below.

Classification - Radio (Single-choice)

radio_annotation = ClassificationAnnotation(
  name="radio_question", 
  value=Radio(answer = ClassificationAnswer(name = "second_radio_answer"))
)
radio_annotation_ndjson = {
  'name': 'radio_question',
  'answer': {'name': 'second_radio_answer'}
}

Classification - Checklist (Multi-choice)

checklist_annotation = ClassificationAnnotation(
  name="checklist_question", # must match your ontology feature's name
  value=Checklist(answer = [ClassificationAnswer(name = "first_checklist_answer"), ClassificationAnswer(name = "second_checklist_answer")])
 )
checklist_annotation_ndjson = {
  'name': 'checklist_question',
  'answer': [
    {'name': 'first_checklist_answer'},
    {'name': 'second_checklist_answer'}
  ]
}

Classification - Free-form text

text_annotation = ClassificationAnnotation(
  name="free_text",  # must match your ontology feature's name
  value=Text(answer="sample text")
)
text_annotation_ndjson = {
  'name': 'free_text',
  'answer': 'sample text',
}