You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"- `client.create_ontology`: Methods used to create Labelbox ontologies for MCE project this requires a `ontology_kind` parameter set to `lb.OntologyKind.ModelEvaluation`\n",
39
41
"\n",
40
42
"- `client.create_ontology_from_feature_schemas`: Similar to `client.create_ontology` but from a list of `feature schema ids` which is designed to allow you to use existing features instead of creating new features. This also requires a `ontology_kind` set to `lb.OntologyKind.ModelEvaluation`."
41
-
]
43
+
],
44
+
"cell_type": "markdown"
42
45
},
43
46
{
44
-
"cell_type": "markdown",
45
47
"metadata": {},
46
48
"source": [
47
49
"## Set Up"
48
-
]
50
+
],
51
+
"cell_type": "markdown"
49
52
},
50
53
{
51
-
"cell_type": "code",
52
-
"execution_count": null,
53
54
"metadata": {},
55
+
"source": "%pip install -q \"labelbox[data]\"",
56
+
"cell_type": "code",
54
57
"outputs": [],
55
-
"source": [
56
-
"%pip install -q \"labelbox[data]\""
57
-
]
58
+
"execution_count": null
58
59
},
59
60
{
60
-
"cell_type": "code",
61
-
"execution_count": null,
62
61
"metadata": {},
62
+
"source": "import labelbox as lb",
63
+
"cell_type": "code",
63
64
"outputs": [],
64
-
"source": [
65
-
"import labelbox as lb"
66
-
]
65
+
"execution_count": null
67
66
},
68
67
{
69
-
"cell_type": "markdown",
70
68
"metadata": {},
71
69
"source": [
72
70
"## API Key and Client\n",
73
71
"Provide a valid API key below in order to properly connect to the Labelbox client. Please review [Create API key guide](https://docs.labelbox.com/reference/create-api-key) for more information."
"## Example: Create Model Chat Evaluation Project\n",
91
86
"\n",
92
87
"The steps to creating a Model Chat Evaluation Project through the Labelbox-Python SDK are similar to creating a regular project. However, they vary slightly, and we will showcase the different methods in this example workflow."
93
-
]
88
+
],
89
+
"cell_type": "markdown"
94
90
},
95
91
{
96
-
"cell_type": "markdown",
97
92
"metadata": {},
98
93
"source": [
99
94
"### Create a MOE Ontology\n",
100
95
"\n",
101
96
"You can create ontologies for Model Evaluation projects the same way as creating ontologies for other projects with the only requirement of passing in a `ontology_kind` parameter which needs set to `lb.OntologyKind.ModelEvaluation`. You can create ontologies with two methods: `client.create_ontology` and `client.create_ontology_from_feature_schemas`."
102
-
]
97
+
],
98
+
"cell_type": "markdown"
103
99
},
104
100
{
105
-
"cell_type": "markdown",
106
101
"metadata": {},
107
102
"source": [
108
103
"#### Option A: `client.create_ontology`\n",
109
104
"\n",
110
105
"Typically, you create ontologies and generate the associated features at the same time. Below is an example of creating an ontology for your model chat evaluation project using supported tools and classifications. For information on supported annotation types visit our [model chat evaluation](https://docs.labelbox.com/docs/model-chat-evaluation#supported-annotation-types) guide."
"Ontologies can also be created with feature schema IDs. This makes your ontologies with existing features compared to generating new features. You can get these features by going to the _Schema_ tab inside Labelbox. (uncomment the below code block for this option)"
"Exporting from a Model Chat Evaluation project works the same as exporting from other projects. In this example, unless you have created labels inside the Labelbox platform your exported will be shown as empty. Please review our [Model Chat Evaluation Export](https://docs.labelbox.com/reference/export-model-chat-evaluation-annotations) guide for a sample export."
232
-
]
170
+
],
171
+
"cell_type": "markdown"
233
172
},
234
173
{
235
-
"cell_type": "code",
236
-
"execution_count": null,
237
174
"metadata": {},
175
+
"source": "# Start export from project\nexport_task = project.export()\nexport_task.wait_till_done()\n\n# Conditional if task has errors\nif export_task.has_errors():\n export_task.get_buffered_stream(stream_type=lb.StreamType.ERRORS).start(\n stream_handler=lambda error: print(error))\n\nif export_task.has_result():\n # Start export stream\n stream = export_task.get_buffered_stream()\n\n # Iterate through data rows\n for data_row in stream:\n print(data_row.json)",
"This section serves as an optional clean-up step to delete the Labelbox assets created within this guide. You will need to uncomment the delete methods shown."
0 commit comments