Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions examples/annotation_import/conversational.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,8 @@
"cell_type": "markdown",
"source": [
"## Step 2: Create/select an ontology\n",
"Your project should have the correct ontology setup with all the tools and classifications supported for your annotations, and the tool and classification names should match the `name` field in your annotations to ensure the correct feature schemas are matched.\n",
"\n",
"Your project should have the correct ontology setup with all the tools and classifications supported for your annotations, and the tool names and classification instructions should match the `name`/`instructions` fields in your annotations to ensure the correct feature schemas are matched.\n",
"\n",
"For example, when we create the bounding box annotation [above](https://colab.research.google.com/drive/1rFv-VvHUBbzFYamz6nSMRJz1mEg6Ukqq#scrollTo=3umnTd-MfI0o&line=1&uniqifier=1), we provided the `name` as `text_convo`. Now, when we setup our ontology, we must ensure that the name of my bounding box tool is also `checklist_convo`. The same alignment must hold true for the other tools and classifications we create in our ontology."
],
Expand All @@ -322,19 +323,19 @@
" Classification( # Text classification given the name \"text\"\n",
" class_type=Classification.Type.TEXT,\n",
" scope=Classification.Scope.INDEX, \n",
" name=\"text_convo\"), \n",
" instructions=\"text_convo\"), \n",
" Classification( # Checklist classification given the name \"text\" with two options: \"first_checklist_answer\" and \"second_checklist_answer\"\n",
" class_type=Classification.Type.CHECKLIST, \n",
" scope=Classification.Scope.INDEX, \n",
" name=\"checklist_convo\", \n",
" instructions=\"checklist_convo\", \n",
" options=[\n",
" Option(value=\"first_checklist_answer\"),\n",
" Option(value=\"second_checklist_answer\") \n",
" ]\n",
" ), \n",
" Classification( # Radio classification given the name \"text\" with two options: \"first_radio_answer\" and \"second_radio_answer\"\n",
" class_type=Classification.Type.RADIO, \n",
" name=\"radio_convo\", \n",
" instructions=\"radio_convo\", \n",
" scope=Classification.Scope.INDEX, \n",
" options=[\n",
" Option(value=\"first_radio_answer\"),\n",
Expand Down
14 changes: 7 additions & 7 deletions examples/annotation_import/image.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@
"cell_type": "markdown",
"source": [
"## Step 2: Create/select an Ontology\n",
"Your project should have the correct ontology setup with all the tools and classifications supported for your annotations, and the tool and classification names should match the `name` field in your annotations to ensure the correct feature schemas are matched.\n",
"Your project should have the correct ontology setup with all the tools and classifications supported for your annotations, and the tool names and classification instructions should match the `name`/`instructions` fields in your annotations to ensure the correct feature schemas are matched.\n",
"\n",
"For example, when we create the bounding box annotation above, we provided the `name` as `polyline`. Now, when we setup our ontology, we must ensure that the name of my bounding box tool is also `polyline`. The same alignment must hold true for the other tools and classifications we create in our ontology.\n",
"\n",
Expand All @@ -606,33 +606,33 @@
" classifications=[ # List of Classification objects\n",
" Classification( # Radio classification given the name \"text\" with two options: \"first_radio_answer\" and \"second_radio_answer\"\n",
" class_type=Classification.Type.RADIO, \n",
" name=\"radio_question\", \n",
" instructions=\"radio_question\", \n",
" options=[\n",
" Option(value=\"first_radio_answer\"),\n",
" Option(value=\"second_radio_answer\")\n",
" ]\n",
" ),\n",
" Classification( # Checklist classification given the name \"text\" with two options: \"first_checklist_answer\" and \"second_checklist_answer\"\n",
" class_type=Classification.Type.CHECKLIST, \n",
" name=\"checklist_question\", \n",
" instructions=\"checklist_question\", \n",
" options=[\n",
" Option(value=\"first_checklist_answer\"),\n",
" Option(value=\"second_checklist_answer\") \n",
" ]\n",
" ), \n",
" Classification( # Text classification given the name \"text\"\n",
" class_type=Classification.Type.TEXT,\n",
" name=\"free_text\"\n",
" instructions=\"free_text\"\n",
" ),\n",
" Classification(\n",
" class_type=Classification.Type.RADIO, \n",
" name=\"nested_radio_question\",\n",
" instructions=\"nested_radio_question\",\n",
" options=[\n",
" Option(\"first_radio_answer\",\n",
" options=[\n",
" Classification(\n",
" class_type=Classification.Type.RADIO,\n",
" name=\"sub_radio_question\",\n",
" instructions=\"sub_radio_question\",\n",
" options=[Option(\"first_sub_radio_answer\")]\n",
" )\n",
" ]\n",
Expand All @@ -651,7 +651,7 @@
" classifications=[\n",
" Classification(\n",
" class_type=Classification.Type.RADIO,\n",
" name=\"sub_radio_question\",\n",
" instructions=\"sub_radio_question\",\n",
" options=[\n",
" Option(value=\"first_sub_radio_answer\")\n",
" ]\n",
Expand Down
12 changes: 6 additions & 6 deletions examples/annotation_import/text.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@
"cell_type": "markdown",
"source": [
"### Step 2: Create/select an ontology\n",
"Your project should have the correct ontology setup with all the tools and classifications supported for your annotations, and the tool and classification names should match the `name` field in your annotations to ensure the correct feature schemas are matched.\n",
"Your project should have the correct ontology setup with all the tools and classifications supported for your annotations, and the tool names and classification instructions should match the `name`/`instructions` fields in your annotations to ensure the correct feature schemas are matched.\n",
"\n",
"For example, when we create the checklist annotation above, we provided the `name` as `checklist_question`. Now, when we setup our ontology, we must ensure that the name of my classification tool is also `checklist_question`. The same alignment must hold true for the other tools and classifications we create in our ontology.\n",
"\n",
Expand All @@ -386,18 +386,18 @@
" classifications=[ # List of Classification objects\n",
" Classification( \n",
" class_type=Classification.Type.RADIO, \n",
" name=\"radio_question\", \n",
" instructions=\"radio_question\", \n",
" options=[Option(value=\"first_radio_answer\")]\n",
" ),\n",
" Classification( \n",
" class_type=Classification.Type.RADIO, \n",
" name=\"radio_question_sub\", \n",
" instructions=\"radio_question_sub\", \n",
" options=[\n",
" Option(value=\"first_radio_answer\",\n",
" options=[\n",
" Classification(\n",
" class_type=Classification.Type.RADIO,\n",
" name=\"sub_radio_question\",\n",
" instructions=\"sub_radio_question\",\n",
" options=[\n",
" Option(value=\"first_sub_radio_answer\")\n",
" ]\n",
Expand All @@ -408,7 +408,7 @@
" ),\n",
" Classification( \n",
" class_type=Classification.Type.CHECKLIST, \n",
" name=\"checklist_question\", \n",
" instructions=\"checklist_question\", \n",
" options=[\n",
" Option(value=\"first_checklist_answer\"),\n",
" Option(value=\"second_checklist_answer\"), \n",
Expand All @@ -417,7 +417,7 @@
" ), \n",
" Classification( # Text classification given the name \"text\"\n",
" class_type=Classification.Type.TEXT,\n",
" name=\"free_text\"\n",
" instructions=\"free_text\"\n",
" )\n",
" ],\n",
" tools=[ # List of Tool objects\n",
Expand Down
17 changes: 9 additions & 8 deletions examples/annotation_import/tiled.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -616,13 +616,14 @@
},
{
"cell_type": "markdown",
"source": [
"### Step 2: Create/select an ontology\n",
"Your project should have the correct ontology setup with all the tools and classifications supported for your annotations, and the tool names and classification instructions should match the `name`/`instructions` fields in your annotations to ensure the correct feature schemas are matched."
],
"metadata": {
"id": "y_tWMvxilTq9"
},
"source": [
"### Step 2: Create/select an ontology\n",
"Your project should have the correct ontology setup with all the tools and classifications supported for your annotations, and the tool and classification names should match the `name` field in your annotations to ensure the correct feature schemas are matched."
]
"id": "y_tWMvxilTq9"
},
{
"cell_type": "code",
Expand All @@ -646,7 +647,7 @@
" classifications=[\n",
" Classification(\n",
" class_type=Classification.Type.CHECKLIST,\n",
" name=\"checklist_class_name\",\n",
" instructions=\"checklist_class_name\",\n",
" options=[\n",
" Option(value=\"first_checklist_answer\")\n",
" ]\n",
Expand All @@ -659,15 +660,15 @@
" classifications=[\n",
" Classification(\n",
" class_type=Classification.Type.TEXT,\n",
" name=\"free_text_geo\"\n",
" instructions=\"free_text_geo\"\n",
" ),\n",
" ]\n",
" ) \n",
" ],\n",
" classifications = [\n",
" Classification(\n",
" class_type=Classification.Type.CHECKLIST, \n",
" name=\"checklist_question_geo\",\n",
" instructions=\"checklist_question_geo\",\n",
" options=[\n",
" Option(value=\"first_checklist_answer\"),\n",
" Option(value=\"second_checklist_answer\"), \n",
Expand All @@ -676,7 +677,7 @@
" ), \n",
" Classification(\n",
" class_type=Classification.Type.RADIO, \n",
" name=\"radio_question_geo\",\n",
" instructions=\"radio_question_geo\",\n",
" options=[\n",
" Option(value=\"first_radio_answer\")\n",
" ]\n",
Expand Down
12 changes: 6 additions & 6 deletions examples/annotation_import/video.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@
},
"source": [
"### Step 2: Create/select an ontology\n",
"Your project should have the correct ontology setup with all the tools and classifications supported for your annotations, and the tool and classification names should match the `name` field in your annotations to ensure the correct feature schemas are matched.\n",
"Your project should have the correct ontology setup with all the tools and classifications supported for your annotations, and the tool names and classification instructions should match the `name`/`instructions` fields in your annotations to ensure the correct feature schemas are matched.\n",
"\n",
"For example, when we create the bounding box annotation above, we provided the `name` as `bbox_video`. Now, when we setup our ontology, we must ensure that the name of my bounding box tool is also `bbox_video`. The same alignment must hold true for the other tools and classifications we create in our ontology.\n",
"\n",
Expand All @@ -531,7 +531,7 @@
" classifications=[\n",
" Classification(\n",
" class_type=Classification.Type.RADIO, \n",
" name=\"bbox_radio\", \n",
" instructions=\"bbox_radio\", \n",
" scope = Classification.Scope.INDEX,\n",
" options=[\n",
" Option(value=\"bbox_radio_answer_1\"),\n",
Expand All @@ -545,7 +545,7 @@
" classifications=[ \n",
" Classification(\n",
" class_type=Classification.Type.CHECKLIST, \n",
" name=\"checklist_class\",\n",
" instructions=\"checklist_class\",\n",
" scope = Classification.Scope.INDEX, ## Need to defined scope for frame classifications \n",
" options=[ \n",
" Option(value=\"first_checklist_answer\"),\n",
Expand All @@ -554,21 +554,21 @@
" ),\n",
" Classification(\n",
" class_type=Classification.Type.RADIO, \n",
" name=\"radio_class_global\",\n",
" instructions=\"radio_class_global\",\n",
" options=[ \n",
" Option(value=\"first_radio_answer\"),\n",
" Option(value=\"second_radio_answer\")\n",
" ]\n",
" ),\n",
" Classification(\n",
" class_type=Classification.Type.RADIO, \n",
" name=\"radio_question_nested\",\n",
" instructions=\"radio_question_nested\",\n",
" options=[\n",
" Option(\"first_radio_question\",\n",
" options=[\n",
" Classification(\n",
" class_type=Classification.Type.RADIO,\n",
" name=\"sub_question_radio\",\n",
" instructions=\"sub_question_radio\",\n",
" options=[Option(\"sub_answer\")]\n",
" )\n",
" ]\n",
Expand Down
4 changes: 2 additions & 2 deletions examples/annotation_types/basics.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1168,15 +1168,15 @@
" name=\"deer_nose\",\n",
" classifications=[\n",
" Classification(class_type=Classification.Type.RADIO,\n",
" name=\"description\",\n",
" instructions=\"description\",\n",
" options=[Option(value=\"wet\")])\n",
" ]),\n",
" Tool(tool=Tool.Type.SEGMENTATION, name=\"deer_eyes\")\n",
"],\n",
" classifications=[\n",
" Classification(\n",
" Classification.Type.CHECKLIST,\n",
" name=\"image_description\",\n",
" instructions=\"image_description\",\n",
" options=[\n",
" Option(value=\"bright\"),\n",
" Option(value=\"not_blurry\"),\n",
Expand Down
4 changes: 2 additions & 2 deletions examples/annotation_types/label_containers.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -207,15 +207,15 @@
" name=\"deer_nose\",\n",
" classifications=[\n",
" Classification(class_type=Classification.Type.RADIO,\n",
" name=\"nose_description\",\n",
" instructions=\"nose_description\",\n",
" options=[Option(value=\"wet\")])\n",
" ]),\n",
" Tool(tool=Tool.Type.SEGMENTATION, name=\"deer_eyes\")\n",
" ],\n",
" classifications=[\n",
" Classification(\n",
" Classification.Type.CHECKLIST,\n",
" name=\"image_description\",\n",
" instructions=\"image_description\",\n",
" options=[\n",
" Option(value=\"bright\"),\n",
" Option(value=\"not_blurry\"),\n",
Expand Down
6 changes: 3 additions & 3 deletions examples/basics/ontologies.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -355,13 +355,13 @@
"execution_count": 13,
"source": [
"text_classification = Classification(class_type=Classification.Type.TEXT,\n",
" name=\"dog_name\")\n",
" instructions=\"dog_name\")\n",
"radio_classification = Classification(class_type=Classification.Type.RADIO,\n",
" name=\"dog_breed\",\n",
" instructions=\"dog_breed\",\n",
" options=[Option(\"poodle\")])\n",
"checklist_classification = Classification(\n",
" class_type=Classification.Type.CHECKLIST,\n",
" name=\"background\",\n",
" instructions=\"background\",\n",
" options=[Option(\"at_park\"), Option(\"has_leash\")])"
],
"outputs": [],
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@

weather_classification = Classification(
class_type=Classification.Type.RADIO,
name="what is the weather?",
instructions="what is the weather?",
options=[Option(value=c) for c in conditions])
ontology.add_classification(weather_classification)

Expand Down
Loading