Export annotations as Python Annotation Types

Open In Colab Open a Colab to go through the exercise of exporting text annotations.

Export JSON annotations

labels = project.export_labels(download=True)

# Optionally, provide a date range as an optional parameter
# This will export only labels created between the supplied dates
# Date range can be formatted as "YYYY-MM-DD" or "YYYY-MM-DD hh:mm:ss"
labels = project.export_labels(download=True, start="2022-09-28", end="2022-10-04")

Annotation export formats

Text entity (named entity)

{
    "featureId": "ck8kulppv000x0yf8pqpqqin4",
    "schemaId": "ck8kukafkqx1a0880iczbrqym",
    "title": "Entity type A",
    "value": "entity_type_a",
    "color": "#8000FF",
    "version": 1,
    "format": "text.location",
    "data": {
        "location": {
            "start": 67,
            "end": 128
        }
    }
}

Relationship

"relationships": [
     {
        "featureId":"cl12o1opb000g3g6acccvuqui",
        "schemaId":"cl12nq1ik004g0z4lf84q58rm",
        "data":
            {
                "source":"cl12nurbd00013g6an63jifsv",
                "target":"cl12nv4ab00073g6as6jkwcj3",
                "label": "verb"
                },
        "relationshipType":"unidirectional",
        "version": 1
    }
]

Radio

{
    "featureId": "cknp3d0hw00013g68wkjemi6o",
    "schemaId": "cknp3ctst06nq0ycte8icc2l3",
    "title": "Is it daytime?",
    "value": "is_it_daytime?",
    "answer": {
        "featureId": "cknp3d0hw00003g685c0nj5c1",
        "schemaId": "cknp3cttx06oe0yct3f0d6pmz",
        "title": "Yes",
        "value": "yes"
    }
}

Checklist

{
  "featureId": "cl89b1d3g00013b6k8388lpol",
  "schemaId": "cl89b186w0xg107xkga0fdf4j",
  "scope": "global",
  "title": "Attributes",
  "value": "attributes",
  "answers": [
    {
      "featureId": "cl89b1dln00033b6ky6j9cb62",
      "schemaId": "cl89b186w0xg407xk4yvkf3o8",
      "title": "Crowded",
      "value": "crowded"
    },
    {
      "featureId": "cl89b1e3z00063b6kll28e559",
      "schemaId": "cl89b186w0xg607xk8ogy304a",
      "title": "Foot traffic",
      "value": "foot_traffic"
    },
    {
      "featureId": "cl89b1ekd000a3b6kbiipqxi7",
      "schemaId": "cl89b186w0xg807xke5kg606w",
      "title": "Vehicle traffic",
      "value": "vehicle_traffic"
    }
  ]
}

Free-form text

{
    "featureId": "cknp3dugp00073g68fkudn092",
    "schemaId": "cknp3ctsu06nu0yctf0v5gzij",
    "title": "Free-form text",
    "value": "free-form_text",
    "answer": "Correct text answer"
}

Sample Label payload - Text

[
    {
        "ID": "cknp3dwk4000b3g68ghqpti7y",
        "DataRow ID": "ckekrwg3zqjbo0bs3hl15ex1i",
        "Labeled Data": "https://storage.googleapis.com/labelbox-sample-datasets/nlp/lorem-ipsum.txt",
        "Label": {
            "objects": [
                {
                    "featureId": "cknp3dvhg000a3g68hujtu6l1",
                    "schemaId": "ckkd4yl0e0le30ycl7i4944l5",
                    "title": "A",
                    "value": "a",
                    "color": "#1CE6FF",
                    "version": 1,
                    "format": "text.location",
                    "data": {
                        "location": {
                            "start": 6,
                            "end": 145
                        }
                    },
                    "instanceURI": "https://api.labelbox.com/masks/feature/cknp3dvhg000a3g68hujtu6l1?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJjazUycnZ4MWtxYXpiMDc3MDBtcTI3eDRsIiwib3JnYW5pemF0aW9uSWQiOiJjazUycnZ4MG1wdzRnMDc2NndncXZqdGw5IiwiaWF0IjoxNjE4ODY2NjI4LCJleHAiOjE2MjE0NTg2Mjh9.tW78CH7C7Nb85w6epSULEpaY4sEg6UeWeSk0WmCP5jg"
                }
            ],
            "classifications": [
                {
                    "featureId": "cknp3d0hw00013g68wkjemi6o",
                    "schemaId": "cknp3ctst06nq0ycte8icc2l3",
                    "title": "Radio",
                    "value": "radio",
                    "answer": {
                        "featureId": "cknp3d0hw00003g685c0nj5c1",
                        "schemaId": "cknp3cttx06oe0yct3f0d6pmz",
                        "title": "Yes",
                        "value": "yes"
                    }
                },
                {
                    "featureId": "cknp3dk5r00013g68lyduuwvp",
                    "schemaId": "cknp3dfo51h900y9y5j10g7hg",
                    "title": "Checklist",
                    "value": "checklist",
                    "answers": [
                        {
                            "featureId": "cknp3dk5r00003g6864se47ef",
                            "schemaId": "cknp3dfv21h9a0y9yagz41wtq",
                            "title": "1",
                            "value": "1"
                        },
                        {
                            "featureId": "cknp3dko500033g685s10zw9u",
                            "schemaId": "cknp3dfv21h9b0y9yg34i8xru",
                            "title": "2",
                            "value": "2"
                        }
                    ]
                }
            ]
        },
        "Created By": "[email protected]",
        "Project Name": "NER",
        "Created At": "2021-04-19T21:10:17.000Z",
        "Updated At": "2021-04-19T21:10:18.000Z",
        "Seconds to Label": 28.293,
        "External ID": null,
        "Agreement": -1,
        "Benchmark Agreement": -1,
        "Benchmark ID": null,
        "Dataset Name": "Lorem ipsum.txt",
        "Reviews": [],
        "View Label": "https://editor.labelbox.com?project=ckkd4xstjqnsb0740zwio6grd&label=cknp3dwk4000b3g68ghqpti7y",
        "Has Open Issues": 0,
        "Skipped": false,
        "DataRow Workflow Info": {
            "taskName": "Done",
            "Workflow History": [
              {
                "actorId": "cl3lobugu14pw0796fau0dgad",
                "action": "APPROVE",
                "createdAt": "2022-09-29T15:46:23.269Z",
                "previousTaskId": "0ae49522-97f0-4a07-96c6-bd4d50963acd",
                "previousTaskName": "Initial review task"
              },
              {
                "actorId": "cl3lobugu14pw0796fau0dgad",
                "action": "REWORK",
                "createdAt": "2022-09-29T14:23:59.735Z",
                "previousTaskId": "4a0d7f40-0c3f-0cc8-adc4-fd818684facd",
                "previousTaskName": "Rework (all rejected)",
                "nextTaskId": "0ae49522-97f0-4a07-96c6-bd4d50963acd",
                "nextTaskName": "Initial review task"
              },
              {
                "actorId": "cl1qe5naj3g460z6e0owr6mwj",
                "action": "REJECT",
                "createdAt": "2022-09-29T13:39:01.077Z",
                "previousTaskId": "0ae49522-97f0-4a07-96c6-bd4d50963acd",
                "previousTaskName": "Initial review task",
                "nextTaskId": "4a0d7f40-0c3f-0cc8-adc4-fd818684facd",
                "nextTaskName": "Rework (all rejected)"
              },
              {
                "actorId": "cl3ucfsj22j8l073xaitnh1xe",
                "action": "MOVE",
                "createdAt": "2022-09-28T18:06:16.881Z",
                "previousTaskId": "ea78e526-e429-002e-8b80-b72c4b591152",
                "previousTaskName": "Initial labeling task",
                "nextTaskId": "0ae49522-97f0-4a07-96c6-bd4d50963acd",
                "nextTaskName": "Initial review task"
              },
              {
                "actorId": "cl3ucfsj22j8l073xaitnh1xe",
                "action": "MOVE",
                "createdAt": "2022-09-28T18:06:16.859Z",
                "nextTaskId": "ea78e526-e429-002e-8b80-b72c4b591152",
                "nextTaskName": "Initial labeling task"
              }
            ]
        }
    }
]