|
63 | 63 | "metadata": {},
|
64 | 64 | "source": [
|
65 | 65 | "## API key and client\n",
|
66 |
| - "Please provide a valid API key below to connect to the Labelbox client properly. For more information, please review the [Create API key guide](https://docs.labelbox.com/reference/create-api-key)." |
| 66 | + "Replace the value of `API_KEY` with a valid [API key]([ref:create-api-key](https://docs.labelbox.com/reference/create-api-key)) to connect to the Labelbox client." |
67 | 67 | ]
|
68 | 68 | },
|
69 | 69 | {
|
|
80 | 80 | "cell_type": "markdown",
|
81 | 81 | "metadata": {},
|
82 | 82 | "source": [
|
83 |
| - "## Example: Create prompt response projects and ontologies\n", |
| 83 | + "## Example: Create prompt and response projects and ontologies\n", |
84 | 84 | "\n",
|
85 |
| - "The steps to creating prompt response projects and ontologies 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." |
| 85 | + "The steps of creating prompt and response projects and corresponding ontologies using the Labelbox-Python SDK are similar to creating a regular project, and we will describe the slight differences for each scenario." |
86 | 86 | ]
|
87 | 87 | },
|
88 | 88 | {
|
|
91 | 91 | "source": [
|
92 | 92 | "### Create a prompt and response ontology\n",
|
93 | 93 | "\n",
|
94 |
| - "You can create ontologies for prompt and response projects in the same way as other project ontologies using two methods: `client.create_ontology` and `client.create_ontology_from_feature_schemas`. For response creation projects the only difference between other projects is the media_type for the project needs to be set to `lb.MediaType.Text`. For prompt and prompt response creation projects you need to include their respective media type: `lb.MediaType.LLMPromptCreation` and `lb.MediaType.LLMPromptResponseCreation`. Additional you also need to provide an `ontology_kind` parameter, which needs to be set to `lb.OntologyKind.ResponseCreation` this is only applicable for prompt and prompt response creation projects." |
| 94 | + "You can create ontologies for prompt and response projects in the same way as other project ontologies using two methods: `client.create_ontology` and `client.create_ontology_from_feature_schemas`. You also need to include the respective `media_type`: `lb.MediaType.LLMPromptCreation` and `lb.MediaType.LLMPromptResponseCreation`. Additionally, you need to provide an `ontology_kind` parameter set to `lb.OntologyKind.ResponseCreation` that is only applicable for prompt and prompt response creation projects." |
95 | 95 | ]
|
96 | 96 | },
|
97 | 97 | {
|
|
100 | 100 | "source": [
|
101 | 101 | "#### Option A: `client.create_ontology`\n",
|
102 | 102 | "\n",
|
103 |
| - "Typically, you create ontologies and generate the associated features simultaneously. Below is an example of creating an ontology for your prompt and response projects using supported classifications; for information on supported annotation types, visit our [prompt and response generation](https://docs.labelbox.com/docs/prompt-and-response-generation-editor) guide.\n", |
| 103 | + "Typically, you create ontologies and generate the associated features simultaneously. Below is an example of creating an ontology for your prompt and response projects using supported classifications; for information on supported annotation types, see [prompt and response generation](https://docs.labelbox.com/docs/prompt-and-response-generation-editor).\n", |
104 | 104 | "\n",
|
105 |
| - "Depending if you were creating a prompt, response, or prompt and response creation projects you would not need certain classifications inside your ontologies. For information on supported annotation types, visit our [prompt and response generation](doc:prompt-and-response-generation-editor#supported-prompt-formats) guide. In this notebook, we will be creating a prompt and response creation ontology. " |
| 105 | + "Depending if you were creating a prompt, response, or prompt and response creation projects, you don't need certain classifications inside your ontologies. For information on supported annotation types, see [prompt and response generation](doc:prompt-and-response-generation-editor#supported-prompt-formats). In this notebook, we will create a prompt and response creation ontology. " |
106 | 106 | ]
|
107 | 107 | },
|
108 | 108 | {
|
|
165 | 165 | "metadata": {},
|
166 | 166 | "source": [
|
167 | 167 | "### Option B: `client.create_ontology_from_feature_schemas`\n",
|
168 |
| - "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)" |
| 168 | + "You can also create ontologies using feature schema IDs, which make your ontologies with existing features instead of generating new features. You can get these features by going to the _Schema_ tab inside Labelbox." |
169 | 169 | ]
|
170 | 170 | },
|
171 | 171 | {
|
|
174 | 174 | "metadata": {},
|
175 | 175 | "outputs": [],
|
176 | 176 | "source": [
|
| 177 | + "# Uncomment the follwing code block for this option\n", |
177 | 178 | "# ontology = client.create_ontology_from_feature_schemas(\n",
|
178 | 179 | "# \"LMC ontology\",\n",
|
179 | 180 | "# feature_schema_ids=[\"<list of feature schema ids\"],\n",
|
|
209 | 210 | "source": [
|
210 | 211 | "## Create prompt response and prompt creation projects\n",
|
211 | 212 | "\n",
|
212 |
| - "When creating a prompt response or prompt creation project using client.create_prompt_response_generation_project, you do not need to create data rows because they are generated automatically. This method takes the same parameters as the traditional client.create_project but with a few specific additional parameters.\n", |
| 213 | + "When creating a prompt response or prompt creation project using `client.create_prompt_response_generation_project()`, you do not need to create data rows because they are generated automatically. This method takes the same parameters as the traditional client.create_project but with a few specific additional parameters.\n", |
213 | 214 | "\n",
|
214 | 215 | "Parameters\n",
|
215 | 216 | "The `client.create_prompt_response_generation_project` method requires the following parameters:\n",
|
|
0 commit comments