How to export conversational text data and sample export formats.
Open this Colab for an interactive tutorial on exporting annotations.
Export JSON annotations
# Set the export params to include/exclude certain fields. Make sure each of these fields are correctly grabbed
export_params= {
"attachments": True,
"metadata_fields": True,
"data_row_details": True,
"project_details": True,
"label_details": True,
"performance_details": True
}
# You can set the range for last_activity_at and label_created_at.
# For context, last_activity_at captures the creation and modification of labels, metadata, status, comments and reviews.
# Note: This is an AND logic between the filters, so usually using one filter is sufficient.
filters= {
"last_activity_at": ["2000-01-01 00:00:00", "2050-01-01 00:00:00"],
}
export_task = project.export_v2(params=export_params, filters=filters)
export_task.wait_till_done()
if export_task.errors:
print(export_task.errors)
export_json = export_task.result
print("results: ", export_json)
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)
{
"feature_id": "cle6b4b0h00053b6j8eaxkbow",
"name": "ner",
"annotation_kind": "ConversationalTextEntity",
"classifications": [],
"conversational_location": {
"message_id": "6",
"location": {
"start": 100,
"end": 103
}
}
}
{
"featureId":"cl2zji82m00043g6cunt8telp",
"schemaId":"cl2zjh37t0jrd08965lr80xva",
"color":"#1CE6FF",
"title":"Person",
"value":"person",
"version":1,
"format":"text.location",
"data":{
"location":{
"messageId":"2",
"start":0,
"end":22
}
}
}
Relationship
{
"feature_id": "cle3a9op500013b6j0rxusjiq",
"name": "relation_1",
"annotation_kind": "TextUnidirectionalRelationship",
"classifications": [],
"unidirectional_relationship": {
"source": "cldne96y201wn13yddm9l2v3j",
"target": "cldouibfq00023b6j51ml2xll"
}
}
{
"featureId":"cl2zjivad00203g6ck8nk7jrt",
"schemaId":"ckrdp1ln400003h6jq23cbjfl",
"data":
{
"source":"cl2zji82m00043g6cunt8telp",
"target":"cl2zjihh600053g6cztv2bblb",
"label":"Person"
},
"relationshipType":"unidirectional",
"version":1
}
Classification - Radio
{
"feature_id": "cldneit9p021y13yd4dwwmdeq",
"name": "radio_convo",
"message_id": "0",
"conversational_radio_answer": {
"feature_id": "cldneit9p021z13ydvshoklij",
"name": "first_radio_answer",
"classifications": []
}
}
{
"featureId": "cknp3d0hw00013g68wkjemi6o",
"schemaId": "cknp3ctst06nq0ycte8icc2l3",
"title": "user sentiment",
"value": "user sentiment?",
"messageId": "1",
"answer": {
"featureId": "cknp3d0hw00003g685c0nj5c1",
"schemaId": "cknp3cttx06oe0yct3f0d6pmz",
"title": "Positive",
"value": "Positive"
}
}
Classification - Checklist
{
"feature_id": "cldneit9p021v13ydt277bg9g",
"name": "checklist_convo",
"message_id": "2",
"conversational_checklist_answers": [
{
"feature_id": "cldneit9p021w13yd8b6c5g9c",
"name": "first_checklist_answer",
"classifications": []
},
{
"feature_id": "cldneit9p021x13ydy7ssezda",
"name": "second_checklist_answer",
"classifications": []
}
]
}
{
"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"
}
]
}
Classification - Free-form text
{
"feature_id": "cldneit9p021u13yd1jf09ws8",
"name": "text_convo",
"message_id": "0",
"conversational_text_answer": {
"content": "the answer to the text questions right here"
}
}
{
"featureId": "ckmuzkkhw000a3g68xegct9wz",
"schemaId": "ckmuzjtfa64bq0y839bn8ci4l",
"title": "Free-form text",
"value": "free-form_text",
"answer": "Correct text answer"
}
Sample project export
{
"data_row": {
"id": "cldnehvbz02s2081p4osxh35y",
"global_key": "258132e4-a323-11ed-8174-0242ac1c000c",
"row_data": "https://storage.googleapis.com/labelbox-developer-testing-assets/conversational_text/1000-conversations/conversation-1.json",
"details": {
"dataset_id": "cldnehuwe03eq073d2t69du1w",
"created_at": "2023-02-02",
"updated_at": "2023-02-02",
"created_by": "[email protected]"
}
},
"media_attributes": {
"mime_type": "application/vnd.labelbox.conversational",
"labelable_ids": [
"0",
"2",
"4",
"6",
"8",
"10",
"12",
"14",
"16",
"18"
],
"message_count": 20
},
"attachments": [],
"metadata_fields": [],
"projects": {
"cldnehvna03p307z727po5dgx": {
"project_name": "conversational_mal_project",
"labels": [
{
"label_kind": "Default",
"version": "1.0.0",
"id": "cldneitaa022013ydxvt4ua3v",
"label_details": {
"created_at": "2023-02-02T17:58:51+00:00",
"updated_at": "2023-02-16T01:43:57+00:00",
"created_by": "[email protected]",
"reviews": []
},
"performance_details": {
"seconds_to_create": 312,
"seconds_to_review": 0,
"skipped": false
},
"annotations": {
"objects": [
{
"feature_id": "cldneit9p021t13ydd9jxpz16",
"name": "ner",
"annotation_kind": "ConversationalTextEntity",
"classifications": [],
"conversational_location": {
"message_id": "4",
"location": {
"start": 0,
"end": 8
}
}
},
{
"feature_id": "cle6b4b0h00053b6j8eaxkbow",
"name": "ner",
"annotation_kind": "ConversationalTextEntity",
"classifications": [],
"conversational_location": {
"message_id": "6",
"location": {
"start": 100,
"end": 103
}
}
}
],
"classifications": [
{
"feature_id": "cldneit9p021u13yd1jf09ws8",
"name": "text_convo",
"message_id": "0",
"conversational_text_answer": {
"content": "the answer to the text questions right here"
}
},
{
"feature_id": "cldneit9p021v13ydt277bg9g",
"name": "checklist_convo",
"message_id": "2",
"conversational_checklist_answers": [
{
"feature_id": "cldneit9p021w13yd8b6c5g9c",
"name": "first_checklist_answer",
"classifications": []
},
{
"feature_id": "cldneit9p021x13ydy7ssezda",
"name": "second_checklist_answer",
"classifications": []
}
]
},
{
"feature_id": "cldneit9p021y13yd4dwwmdeq",
"name": "radio_convo",
"message_id": "0",
"conversational_radio_answer": {
"feature_id": "cldneit9p021z13ydvshoklij",
"name": "first_radio_answer",
"classifications": []
}
}
],
"relationships": []
}
}
],
"project_details": {
"ontology_id": "cldnehw8j02sa081pbulpbceh",
"batch_id": "38b1c270-a323-11ed-942d-1b34f74683db",
"priority": 5,
"consensus_expected_label_count": 1,
"workflow_history": []
}
}
}
}
[
{
"ID":"cl2zjh5cy0jrk0896c8cibz7c",
"DataRow ID":"cl1l52wx403vs0zy1g35hcj9h",
"Labeled Data":"https://storage.googleapis.com/labelbox-developer-testing-assets/conversational_text/data.json",
"Label":{
"objects":[
{
"featureId":"cl2zji82m00043g6cunt8telp",
"schemaId":"cl2zjh37t0jrd08965lr80xva",
"color":"#1CE6FF",
"title":"Person",
"value":"person",
"version":1,
"format":"text.location",
"data":{
"location":{
"messageId":"2", //This matches the messageID on the import file
"start":0,
"end":22
}
}
},
{
"featureId":"cl2zjihh600053g6cztv2bblb",
"schemaId":"cl2zjh37t0jrd08965lr80xva",
"color":"#1CE6FF",
"title":"Person",
"value":"person",
"version":1,
"format":"text.location",
"data":{
"location":{
"messageId":"4",
"start":0,
"end":13
}
}
}
],
"classifications":[],
"relationships": [
{
"featureId":"cl2zjivad00203g6ck8nk7jrt",
"schemaId":"ckrdp1ln400003h6jq23cbjfl",
"data":{
"source":"cl2zji82m00043g6cunt8telp",
"target":"cl2zjihh600053g6cztv2bblb",
"label":"Person"
},
"relationshipType":"unidirectional",
"version":1
}
]
},
"Created By":"[email protected]",
"Project Name":"Convo Docs",
"Created At":"2022-05-10T02:35:24.000Z",
"Updated At":"2022-05-10T02:35:24.834Z",
"Seconds to Label":103.85499999999999,
"External ID":"Longer_Convo_Example",
"Agreement":-1,
"Benchmark Agreement":-1,
"Benchmark ID":null,
"Dataset Name":"Conversation 1.json",
"Reviews":[],
"View Label":"https://staging.labelbox.dev/editor?project=cl2zjfkt60jnv0896gb9367nd&label=cl2zjh5cy0jrk0896c8cibz7c",
"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"
}
]
}
}
]
Sample model run export
{
"data_row": {
"id": "clfcvlumf075a076phy0yc2b8",
"global_key": "conversation-1.json",
"row_data": "https://storage.googleapis.com/labelbox-developer-testing-assets/conversational_text/1000-conversations/conversation-1.json",
"details": {
"dataset_id": "clfcvlt410so807135gnq7ok9",
"created_at": "2023-03-17T18:31:02.000+00:00",
"updated_at": "2023-03-17T18:31:02.000+00:00",
"created_by": "[email protected]"
}
},
"media_attributes": {
"mime_type": "application/vnd.labelbox.conversational",
"labelable_ids": [
"0",
"2",
"4",
"6",
"8",
"10",
"12",
"14",
"16",
"18"
],
"message_count": 20
},
"attachments": [],
"metadata_fields": [],
"experiments": {
"a1311270-b4fb-035c-b029-b5daa32ba519": {
"name": "Conversational_model_run_67082462-50be-4fc3-b0c4-b3839d711b4d",
"runs": {
"a1311271-30d4-010d-9b1e-ef3ed5240d9c": {
"name": "iteration 1",
"run_data_row_id": "231badd0-d052-4115-b405-c954001d5e4b",
"labels": [
{
"label_kind": "Default",
"version": "1.0.0",
"id": "clgz7h1v505z11437b4xlsni5",
"annotations": {
"objects": [
{
"feature_id": "55861cea-f9f0-4481-8a78-255410aed435",
"name": "ner",
"annotation_kind": "ConversationalTextEntity",
"classifications": [],
"conversational_location": {
"message_id": "4",
"location": {
"start": 0,
"end": 8
}
}
}
],
"classifications": [
{
"feature_id": "07108c90-9e13-4cad-93f5-c863d4c818bb",
"name": "nested_checklist_question",
"message_id": "10",
"conversational_checklist_answers": [
{
"feature_id": "5adbf8cd-fd7c-40fe-981f-d6d85ced6134",
"name": "first_checklist_answer",
"classifications": [
{
"feature_id": "2d6da50a-68b0-443e-96c8-06fcf7f9681f",
"name": "sub_checklist_question",
"checklist_answers": [
{
"feature_id": "a41b5363-285b-4637-a147-ef46d63554c9",
"name": "first_sub_checklist_answer",
"classifications": []
}
]
}
]
}
]
},
{
"feature_id": "0cf5f7da-c3bb-4939-b930-f1ceb11462e0",
"name": "nested_radio_question",
"radio_answer": {
"feature_id": "d4c3f5b9-f953-4551-a21e-5ab3ce14de96",
"name": "first_radio_answer",
"classifications": [
{
"feature_id": "f039ddb4-252e-4ea9-80cd-7d5a87046f66",
"name": "sub_radio_question",
"radio_answer": {
"feature_id": "3460f6a4-c1eb-4cc0-9874-88ec8cf1c1c9",
"name": "first_sub_radio_answer",
"classifications": []
}
}
]
}
},
{
"feature_id": "aa10276f-9609-45e4-bdb1-10e0eee40019",
"name": "text_convo",
"message_id": "0",
"conversational_text_answer": {
"content": "the answer to the text questions are right here"
}
},
{
"feature_id": "c8fe163c-db8c-43c6-87fb-d96bac1ee618",
"name": "checklist_convo",
"message_id": "2",
"conversational_checklist_answers": [
{
"feature_id": "59a61fb1-db21-4e0f-b139-10e6bbad2889",
"name": "second_checklist_answer",
"classifications": []
},
{
"feature_id": "d17a8c15-68dc-44f5-849d-6da012ad788c",
"name": "first_checklist_answer",
"classifications": []
}
]
},
{
"feature_id": "f40619f4-f74d-4214-a6b6-2881e487c660",
"name": "radio_convo",
"message_id": "0",
"conversational_radio_answer": {
"feature_id": "452cc7aa-1138-4a1f-8af2-398c75d4dd0e",
"name": "first_radio_answer",
"classifications": []
}
}
],
"relationships": []
}
}
],
"predictions": [
{
"label_kind": "Default",
"version": "1.0.0",
"id": "clgz7h1v505z11437b4xlsni5",
"annotations": {
"objects": [
{
"feature_id": "f61b9c74-fd8a-4118-818c-5966fc57b1e9",
"name": "ner",
"annotation_kind": "ConversationalTextEntity",
"classifications": [],
"conversational_location": {
"message_id": "4",
"location": {
"start": 0,
"end": 8
}
}
}
],
"classifications": [
{
"feature_id": "2d8a8b19-6974-4eeb-b72d-a4f05ca6b18a",
"name": "radio_convo",
"message_id": "0",
"conversational_radio_answer": {
"feature_id": "2cf7895d-9fec-4b1e-921c-9b8e6bfea320",
"name": "first_radio_answer",
"classifications": []
}
},
{
"feature_id": "327c48f1-9455-410a-ace5-43e27233cf9f",
"name": "nested_checklist_question",
"message_id": "10",
"conversational_checklist_answers": [
{
"feature_id": "3d24471d-1e25-4d19-b21f-03428170b296",
"name": "first_checklist_answer",
"classifications": [
{
"feature_id": "d00274b9-29b4-44d6-ae02-647d0b368dd6",
"name": "sub_checklist_question",
"checklist_answers": [
{
"feature_id": "b598f4c9-872a-4c64-a8ae-66ca64cebbf8",
"name": "first_sub_checklist_answer",
"classifications": []
}
]
}
]
}
]
},
{
"feature_id": "35f74043-67d8-4d82-a347-6394991222f3",
"name": "nested_radio_question",
"radio_answer": {
"feature_id": "f6c62fe5-6f97-423e-9f10-f724b1429ef3",
"name": "first_radio_answer",
"classifications": [
{
"feature_id": "457d3d7b-a2dd-4cdf-9ab8-1b3a36570226",
"name": "sub_radio_question",
"radio_answer": {
"feature_id": "4d5dff74-523a-482a-ab97-27734ab13805",
"name": "first_sub_radio_answer",
"classifications": []
}
}
]
}
},
{
"feature_id": "65e1aecd-a2f0-4606-b0b6-5c44b286f0d6",
"name": "text_convo",
"message_id": "0",
"conversational_text_answer": {
"content": "the answer to the text questions are right here"
}
},
{
"feature_id": "e4ed6ebc-87c5-49a8-949d-46638c29dd96",
"name": "checklist_convo",
"message_id": "2",
"conversational_checklist_answers": [
{
"feature_id": "0fb01208-6d4d-47e4-8787-ee3c3b66cfcc",
"name": "first_checklist_answer",
"classifications": []
},
{
"feature_id": "e23f779d-a491-4330-97f6-61fd2acfb83c",
"name": "second_checklist_answer",
"classifications": []
}
]
}
],
"relationships": []
}
}
]
}
}
}
}
}