Skip to content

Commit

Permalink
3.58.0 (#1325)
Browse files Browse the repository at this point in the history
  • Loading branch information
yamini-labelbox authored Dec 11, 2023
2 parents eaf6efc + 57790a2 commit 8ec4bca
Show file tree
Hide file tree
Showing 63 changed files with 3,843 additions and 1,186 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

# Version 3.58.0 (2023-12-11)
## Added
* `ontology_id` to the model app instantiation
* LLM data generation label types
* `run_foundry_app` to support running model foundry apps
* Two methods for sending data rows to any workflow task in a project, that can also include predictions from a model run, or annotations from a different project
## Fixed
* Documentation index for identifiables
## Removed
* Project.datasets and Datasets.projects methods as they have been deprecated
## Notebooks
* Added note books for Human labeling(GT/MAL/MEA) + data generation (GT/MAL)
* Remove relationship annotations from text and conversational imports

# Version 3.57.0 (2023-11-30)
## Added
* Global key support for Project move_data_rows_to_task_queue
Expand Down
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ test-onprem: build-image
-e LABELBOX_TEST_ONPREM_HOSTNAME=${LABELBOX_TEST_ONPREM_HOSTNAME} \
local/labelbox-python:test pytest $(PATH_TO_TEST)

test-dev0: build-image
docker run -it --rm -v ${PWD}:/usr/src -w /usr/src \
-e LABELBOX_TEST_ENVIRON="custom" \
-e DA_GCP_LABELBOX_API_KEY=${DA_GCP_LABELBOX_API_KEY} \
-e LABELBOX_TEST_API_KEY_CUSTOM=${LABELBOX_TEST_API_KEY_CUSTOM} \
-e LABELBOX_TEST_GRAPHQL_API_ENDPOINT="https://api.dev0.na-us.lb-dev.xyz/graphql" \
-e LABELBOX_TEST_REST_API_ENDPOINT="https://api.dev0.na-us.lb-dev.xyz/api/v1" \
local/labelbox-python:test pytest $(PATH_TO_TEST)

test-custom: build-image
docker run -it --rm -v ${PWD}:/usr/src -w /usr/src \
-e LABELBOX_TEST_ENVIRON="custom" \
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
copyright = '2021, Labelbox'
author = 'Labelbox'

release = '3.57.0'
release = '3.58.0'

# -- General configuration ---------------------------------------------------

Expand Down
1 change: 1 addition & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ ExportTask
---------------------------
.. automodule:: labelbox.schema.export_task
:members:
:exclude-members: FileRetrieverByLine, FileRetrieverByOffset, FileRetrieverStrategy, Range, Converter
:show-inheritance:

Identifiables
Expand Down
165 changes: 44 additions & 121 deletions examples/annotation_import/conversational.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,17 @@
"# Conversational Text Annotation Import\n",
"* This notebook will provide examples of each supported annotation type for conversational text assets, and also cover MAL and Label Import methods:\n",
"\n",
"Suported annotations that can be uploaded through the SDK\n",
"Supported annotations that can be uploaded through the SDK\n",
"\n",
"* Classification Radio \n",
"* Classification Checklist \n",
"* Classification Free Text \n",
"* NER\n",
"* Relationships (only supported for MAL imports)\n",
"\n",
"\n",
"**Not** supported annotations\n",
"\n",
"* Relationships\n",
"* Bouding box \n",
"* Polygon \n",
"* Point\n",
Expand Down Expand Up @@ -139,11 +140,11 @@
" )\n",
")\n",
"\n",
"ner_annotation_ndjson = { \n",
"ner_annotation_ndjson = {\n",
" \"name\": \"ner\",\n",
" \"location\": { \n",
" \"start\": 0, \n",
" \"end\": 8 \n",
" \"location\": {\n",
" \"start\": 0,\n",
" \"end\": 8\n",
" },\n",
" \"messageId\": \"4\"\n",
" }"
Expand Down Expand Up @@ -177,15 +178,15 @@
{
"metadata": {},
"source": [
"##### Checklist Classification ####### \n",
"##### Checklist Classification #######\n",
"\n",
"checklist_annotation= lb_types.ClassificationAnnotation(\n",
" name=\"checklist_convo\", # must match your ontology feature\"s name\n",
" value=lb_types.Checklist(\n",
" answer = [\n",
" lb_types.ClassificationAnswer(\n",
" name = \"first_checklist_answer\"\n",
" ), \n",
" ),\n",
" lb_types.ClassificationAnswer(\n",
" name = \"second_checklist_answer\"\n",
" )\n",
Expand Down Expand Up @@ -214,7 +215,7 @@
"######## Radio Classification ######\n",
"\n",
"radio_annotation = lb_types.ClassificationAnnotation(\n",
" name=\"radio_convo\", \n",
" name=\"radio_convo\",\n",
" value=lb_types.Radio(answer = lb_types.ClassificationAnswer(name = \"first_radio_answer\")),\n",
" message_id=\"0\"\n",
")\n",
Expand All @@ -231,71 +232,6 @@
"outputs": [],
"execution_count": null
},
{
"metadata": {},
"source": [
"####### Relationships ########## \n",
"ner_source = lb_types.ObjectAnnotation(\n",
" name=\"ner\",\n",
" value=lb_types.ConversationEntity(\n",
" start=16,\n",
" end=26,\n",
" message_id=\"4\"\n",
" )\n",
")\n",
"ner_target = lb_types.ObjectAnnotation(\n",
" name=\"ner\",\n",
" value=lb_types.ConversationEntity(\n",
" start=29, \n",
" end=34, \n",
" message_id=\"4\"\n",
" )\n",
")\n",
"\n",
"ner_relationship = lb_types.RelationshipAnnotation(\n",
" name=\"relationship\",\n",
" value=lb_types.Relationship(\n",
" source=ner_source,\n",
" target=ner_target,\n",
" type=lb_types.Relationship.Type.UNIDIRECTIONAL,\n",
" ))\n",
"\n",
"uuid_source = str(uuid.uuid4())\n",
"uuid_target = str(uuid.uuid4())\n",
"\n",
"ner_source_ndjson = { \n",
" \"uuid\": uuid_source, \n",
" \"name\": \"ner\",\n",
" \"location\": { \n",
" \"start\": 16, \n",
" \"end\": 26 \n",
" },\n",
" \"messageId\": \"4\"\n",
" }\n",
"\n",
"ner_target_ndjson = { \n",
" \"uuid\": uuid_target,\n",
" \"name\": \"ner\",\n",
" \"location\": { \n",
" \"start\": 29, \n",
" \"end\": 34\n",
" },\n",
" \"messageId\": \"4\"\n",
" }\n",
"\n",
"ner_relationship_annotation_ndjson = {\n",
" \"name\": \"relationship\", \n",
" \"relationship\": {\n",
" \"source\": uuid_source,\n",
" \"target\": uuid_target,\n",
" \"type\": \"bidirectional\"\n",
" }\n",
"}"
],
"cell_type": "code",
"outputs": [],
"execution_count": null
},
{
"metadata": {},
"source": [
Expand Down Expand Up @@ -328,12 +264,12 @@
" \"name\": \"first_checklist_answer\",\n",
" \"classifications\" : [\n",
" {\n",
" \"name\": \"sub_checklist_question\", \n",
" \"name\": \"sub_checklist_question\",\n",
" \"answer\": {\n",
" \"name\": \"first_sub_checklist_answer\"\n",
" }\n",
" } \n",
" ] \n",
" }\n",
" ]\n",
" }]\n",
"}\n",
"# Global\n",
Expand Down Expand Up @@ -424,28 +360,27 @@
"metadata": {},
"source": [
"ontology_builder = lb.OntologyBuilder(\n",
" tools=[ \n",
" tools=[\n",
" lb.Tool(tool=lb.Tool.Type.NER,name=\"ner\"),\n",
" lb.Tool(tool=lb.Tool.Type.RELATIONSHIP,name=\"relationship\")\n",
" ], \n",
" classifications=[ \n",
" lb.Classification( \n",
" ],\n",
" classifications=[\n",
" lb.Classification(\n",
" class_type=lb.Classification.Type.TEXT,\n",
" scope=lb.Classification.Scope.INDEX, \n",
" name=\"text_convo\"), \n",
" lb.Classification( \n",
" class_type=lb.Classification.Type.CHECKLIST, \n",
" scope=lb.Classification.Scope.INDEX, \n",
" name=\"checklist_convo\", \n",
" scope=lb.Classification.Scope.INDEX,\n",
" name=\"text_convo\"),\n",
" lb.Classification(\n",
" class_type=lb.Classification.Type.CHECKLIST,\n",
" scope=lb.Classification.Scope.INDEX,\n",
" name=\"checklist_convo\",\n",
" options=[\n",
" lb.Option(value=\"first_checklist_answer\"),\n",
" lb.Option(value=\"second_checklist_answer\") \n",
" lb.Option(value=\"second_checklist_answer\")\n",
" ]\n",
" ), \n",
" lb.Classification( \n",
" class_type=lb.Classification.Type.RADIO, \n",
" name=\"radio_convo\", \n",
" scope=lb.Classification.Scope.INDEX, \n",
" ),\n",
" lb.Classification(\n",
" class_type=lb.Classification.Type.RADIO,\n",
" name=\"radio_convo\",\n",
" scope=lb.Classification.Scope.INDEX,\n",
" options=[\n",
" lb.Option(value=\"first_radio_answer\"),\n",
" lb.Option(value=\"second_radio_answer\")\n",
Expand All @@ -460,7 +395,7 @@
" options=[\n",
" lb.Classification(\n",
" class_type=lb.Classification.Type.CHECKLIST,\n",
" name=\"sub_checklist_question\", \n",
" name=\"sub_checklist_question\",\n",
" options=[lb.Option(\"first_sub_checklist_answer\")]\n",
" )\n",
" ])\n",
Expand Down Expand Up @@ -503,10 +438,10 @@
"metadata": {},
"source": [
"# Create Labelbox project\n",
"project = client.create_project(name=\"Conversational Text Annotation Import Demo\", \n",
"project = client.create_project(name=\"Conversational Text Annotation Import Demo\",\n",
" media_type=lb.MediaType.Conversational)\n",
"\n",
"# Setup your ontology \n",
"# Setup your ontology\n",
"project.setup_editor(ontology) # Connect your ontology and editor to your project"
],
"cell_type": "code",
Expand All @@ -523,8 +458,6 @@
{
"metadata": {},
"source": [
"# Setup Batches and Ontology\n",
"\n",
"# Create a batch to send to your MAL project\n",
"batch = project.create_batch(\n",
" \"first-batch-convo-demo\", # Each batch in a project must have a unique name\n",
Expand Down Expand Up @@ -570,9 +503,6 @@
" text_annotation,\n",
" checklist_annotation,\n",
" radio_annotation,\n",
" ner_source,\n",
" ner_target,\n",
" ner_relationship,\n",
" nested_radio_annotation,\n",
" nested_checklist_annotation\n",
" ]\n",
Expand Down Expand Up @@ -600,9 +530,6 @@
" text_annotation_ndjson,\n",
" checklist_annotation_ndjson,\n",
" radio_annotation_ndjson,\n",
" ner_source_ndjson,\n",
" ner_target_ndjson,\n",
" ner_relationship_annotation_ndjson,\n",
" nested_checklist_annotation_ndjson,\n",
" nested_radio_annotation_ndjson\n",
" ]:\n",
Expand Down Expand Up @@ -637,9 +564,9 @@
"source": [
"# Upload our label using Model-Assisted Labeling\n",
"upload_job = lb.MALPredictionImport.create_from_objects(\n",
" client = client, \n",
" project_id = project.uid, \n",
" name=f\"mal_job-{str(uuid.uuid4())}\", \n",
" client = client,\n",
" project_id = project.uid,\n",
" name=f\"mal_job-{str(uuid.uuid4())}\",\n",
" predictions=label)\n",
"\n",
"upload_job.wait_until_done()\n",
Expand All @@ -660,20 +587,16 @@
{
"metadata": {},
"source": [
"# Upload label for this data row in project \n",
"# Uncomment this code when excluding relationships from label import\n",
"# Relationships are not currently supported for label import\n",
"# Upload label for this data row in project\n",
"upload_job = lb.LabelImport.create_from_objects(\n",
" client = client,\n",
" project_id = project.uid,\n",
" name=\"label_import_job\"+str(uuid.uuid4()),\n",
" labels=label)\n",
"\n",
"\n",
"# upload_job = lb.LabelImport.create_from_objects(\n",
"# client = client, \n",
"# project_id = project.uid, \n",
"# name=\"label_import_job\"+str(uuid.uuid4()), \n",
"# labels=label)\n",
"\n",
"# upload_job.wait_until_done();\n",
"# print(\"Errors:\", upload_job.errors)\n",
"# print(\"Status of uploads: \", upload_job.statuses)"
"upload_job.wait_until_done()\n",
"print(\"Errors:\", upload_job.errors)\n",
"print(\"Status of uploads: \", upload_job.statuses)"
],
"cell_type": "code",
"outputs": [],
Expand Down
Loading

0 comments on commit 8ec4bca

Please sign in to comment.