Skip to content

Commit 01cc9da

Browse files
committed
Update banking notebook
1 parent 8b66fd4 commit 01cc9da

File tree

1 file changed

+22
-24
lines changed

1 file changed

+22
-24
lines changed

examples/text-classification/sklearn/banking/demo-banking.ipynb

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -194,29 +194,11 @@
194194
},
195195
"outputs": [],
196196
"source": [
197-
"# Comment this out and uncomment the next section to load the project\n",
198-
"project = client.create_project(\n",
197+
"project = client.create_or_load_project(\n",
199198
" name=\"Sklearn Banking Project\",\n",
200199
" description=\"Project to Demo Sklearn with Unbox\",\n",
201200
" task_type=TaskType.TextClassification,\n",
202-
")\n",
203-
"\n",
204-
"# Use this for loading the project on subsequent runs\n",
205-
"'''\n",
206-
"project = client.load_project(\n",
207-
" name=\"Sklearn Banking Project\"\n",
208-
")\n",
209-
"'''\n",
210-
"\n",
211-
"unbox_model = project.add_model(\n",
212-
" function=predict_function, \n",
213-
" model=model,\n",
214-
" model_type=ModelType.sklearn,\n",
215-
" class_names=label_list,\n",
216-
" name='Banking Model',\n",
217-
" description='this is my sklearn banking model'\n",
218-
")\n",
219-
"unbox_model.to_dict()"
201+
")"
220202
]
221203
},
222204
{
@@ -231,12 +213,28 @@
231213
" class_names=label_list,\n",
232214
" label_column_name=\"label_code\",\n",
233215
" text_column_name=\"text\",\n",
234-
" task_type=TaskType.TextClassification,\n",
235-
" name=\"Banking Test Dataset\",\n",
236-
" description=\"my banking validation dataset\"\n",
216+
" commit_message=\"first version\"\n",
237217
")\n",
238218
"dataset.to_dict()"
239219
]
220+
},
221+
{
222+
"cell_type": "code",
223+
"execution_count": null,
224+
"id": "e23831c4",
225+
"metadata": {},
226+
"outputs": [],
227+
"source": [
228+
"unbox_model = project.add_model(\n",
229+
" function=predict_function, \n",
230+
" model=model,\n",
231+
" model_type=ModelType.sklearn,\n",
232+
" class_names=label_list,\n",
233+
" name='Banking Model',\n",
234+
" commit_message='first version'\n",
235+
")\n",
236+
"unbox_model.to_dict()"
237+
]
240238
}
241239
],
242240
"metadata": {
@@ -255,7 +253,7 @@
255253
"name": "python",
256254
"nbconvert_exporter": "python",
257255
"pygments_lexer": "ipython3",
258-
"version": "3.8.12"
256+
"version": "3.8.10"
259257
}
260258
},
261259
"nbformat": 4,

0 commit comments

Comments
 (0)