Skip to main content

Open In Colab

GitHub

Supported predictions

To upload predictions in Labelbox, you need to create a predictions payload. In this section, we provide this payload for every supported prediction type. Labelbox supports two formats for the predictions payload:
  • Python annotation types (recommended)
  • NDJSON
Both are described below.

Entity

Global classification: Radio

Message-based classification: Radio

Message-based classification: Free-form text

Message-based classification: Checklist

Message-based nested classifications: Checklist and radio

End-to-end example: Upload predictions to a model run

Here are the steps to upload predictions to a model run:

Before you start

You will need to import these libraries to use the code examples in this section:
Replace the value of API_KEY with a valid API key to connect to the Labelbox client.

Step 1: Import data rows into Catalog

Step 2: Create/select an ontology for your model predictions

For best results, verify your ontology before submitting a model run. Verify that:
  • Your ontology supports all features and classifications that might be needed during the model run.
  • Tool names and classification instructions match the name and instructions fields in your annotation payloads.
This helps ensure that feature schemas match your intentions.

Step 3: Create a model and a model run

Step 4: Send data rows to the model run

Step 5: Create the predictions payload

Create the prediction payload using the code snippets in the section above. Labelbox supports two formats for the annotations payload: NDJSON and Python annotation types. Both are described below to compose your annotations into labels attached to the data rows. The resulting payload should have exactly the same content for the annotations supported by both formats.

Python annotations

NDJSON

Step 6: Upload the predictions payload to the model run

Step 7: Send annotations to the model run

To send annotations to a model run, we must first import them into a project, create a label payload and then send them to the model run.