Skip to content

Commit a71cd45

Browse files
Merge pull request #2016 from Esri/jy-rvw-mod-ext
update markdown headings for correct navigation
2 parents 47495e5 + 6b18df4 commit a71cd45

File tree

1 file changed

+37
-29
lines changed

1 file changed

+37
-29
lines changed

guide/14-deep-learning/add_custom_nlp_models_using_model_extension.ipynb

Lines changed: 37 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
{
22
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"id": "d048eaea-3ea5-45b7-9a93-191777d3dd82",
6+
"metadata": {},
7+
"source": [
8+
"# Creating Custom NLP Model with Model Extensiblity"
9+
]
10+
},
311
{
412
"cell_type": "markdown",
513
"id": "168721af",
@@ -27,15 +35,15 @@
2735
"id": "4941d9fb",
2836
"metadata": {},
2937
"source": [
30-
"# Writing Python NLP Function"
38+
"## Writing Python NLP Function"
3139
]
3240
},
3341
{
3442
"cell_type": "markdown",
3543
"id": "6973c6c7",
3644
"metadata": {},
3745
"source": [
38-
"## Anatomy of a Python NLP Function"
46+
"### Anatomy of a Python NLP Function"
3947
]
4048
},
4149
{
@@ -67,49 +75,49 @@
6775
"id": "eb0c423a",
6876
"metadata": {},
6977
"source": [
70-
"### `__init__`\n",
78+
"* `__init__`\n",
7179
"\n",
72-
"The `__init__` method initializes class variables such as `name`, `description`, and other attributes essential for your NLP function.\n",
80+
" This method initializes class variables such as `name`, `description`, and other attributes essential for your NLP function.\n",
7381
"\n",
74-
"### `initialize`\n",
82+
"* `initialize`\n",
7583
"\n",
76-
"The `initialize` method is called at the start of your Python NLP function. Use this method to load the NLP model and set up any initial configurations.\n",
84+
" This is called at the start of your Python NLP function. Use this method to load the NLP model and set up any initial configurations.\n",
7785
"\n",
78-
"### `getParameterInfo`\n",
86+
"* `getParameterInfo`\n",
7987
"\n",
80-
"The `getParameterInfo` method specifies the parameters that your NLP function accepts. This includes text inputs and any configuration settings required for processing.\n",
88+
" This method specifies the parameters that your NLP function accepts. This includes text inputs and any configuration settings required for processing.\n",
8189
"\n",
82-
"### `getConfiguration`\n",
90+
"* `getConfiguration`\n",
8391
"\n",
84-
"The `getConfiguration` method describes how the function should handle input processing and generate outputs. It includes details on any pre-processing or post-processing steps necessary for the function.\n",
92+
" This method describes how the function should handle input processing and generate outputs. It includes details on any pre-processing or post-processing steps necessary for the function.\n",
8593
"\n",
86-
"### `predict`\n",
94+
"* `predict`\n",
8795
"\n",
88-
"The `predict` method is the core function responsible for converting input text into the desired output. It uses the defined parameters and processing logic to produce the final result.\n"
96+
" This method is the core function responsible for converting input text into the desired output. It uses the defined parameters and processing logic to produce the final result.\n"
8997
]
9098
},
9199
{
92100
"cell_type": "markdown",
93101
"id": "014a6dc9",
94102
"metadata": {},
95103
"source": [
96-
"## In-Depth Method Overview\n"
104+
"### In-Depth Method Overview\n"
97105
]
98106
},
99107
{
100108
"cell_type": "markdown",
101109
"id": "17735a1e",
102110
"metadata": {},
103111
"source": [
104-
"### `__init__()`"
112+
"* `__init__()`"
105113
]
106114
},
107115
{
108116
"cell_type": "markdown",
109117
"id": "e30241ac",
110118
"metadata": {},
111119
"source": [
112-
"The `__init__` method initializes class variables such as name, description, and other attributes essential for your NLP function. This method sets up the foundational properties that will define the behavior and characteristics of your NLP component. \n",
120+
"This method initializes class variables such as name, description, and other attributes essential for your NLP function. This method sets up the foundational properties that will define the behavior and characteristics of your NLP component. \n",
113121
"\n",
114122
"It is responsible for creating an instance of your NLP class with all the necessary attributes required for processing and analysis. When you create an instance of your NLP class, this method makes sure it has all the required settings and default values. For instance, if your NLP function needs specific settings such as paths to models, or special tokens, this is where you set those up."
115123
]
@@ -148,7 +156,7 @@
148156
"id": "a9958400",
149157
"metadata": {},
150158
"source": [
151-
"### `initialize()`"
159+
"* `initialize()`"
152160
]
153161
},
154162
{
@@ -188,7 +196,7 @@
188196
"id": "11e3da28",
189197
"metadata": {},
190198
"source": [
191-
"### `getParameterInfo()`"
199+
"* `getParameterInfo()`"
192200
]
193201
},
194202
{
@@ -253,7 +261,7 @@
253261
"id": "b6d674aa",
254262
"metadata": {},
255263
"source": [
256-
"### `getConfiguration()`"
264+
"* `getConfiguration()`"
257265
]
258266
},
259267
{
@@ -304,7 +312,7 @@
304312
"id": "30cd88e7",
305313
"metadata": {},
306314
"source": [
307-
"### Explanation\n",
315+
"#### Explanation\n",
308316
"\n",
309317
"This method configures the NLP function by:\n",
310318
"\n",
@@ -319,7 +327,7 @@
319327
"id": "e6798934",
320328
"metadata": {},
321329
"source": [
322-
"### `predict()`"
330+
"* `predict()`"
323331
]
324332
},
325333
{
@@ -387,7 +395,7 @@
387395
"id": "62a2a40b",
388396
"metadata": {},
389397
"source": [
390-
"# Refer to the custom NLP function in the Esri Model Definition (.emd) File"
398+
"## Refer to the custom NLP function in the Esri Model Definition (.emd) File"
391399
]
392400
},
393401
{
@@ -425,7 +433,7 @@
425433
"id": "a5490415",
426434
"metadata": {},
427435
"source": [
428-
"# Create Custom Deep Learning Package (.dlpk) Model File\n",
436+
"## Create Custom Deep Learning Package (.dlpk) Model File\n",
429437
"\n",
430438
"To finalize your custom NLP setup, you need to create a Deep Learning Package (.dlpk) model file. This .dlpk file will enable you to use your model with the `arcgis.learn` Python API and integrate it into the text analysis toolset.\n",
431439
"\n",
@@ -485,11 +493,11 @@
485493
"id": "da397fa7",
486494
"metadata": {},
487495
"source": [
488-
"# Using the Custom .dlpk with the arcgis.learn API\n",
496+
"## Using the Custom .dlpk with the arcgis.learn API\n",
489497
"\n",
490498
"The `arcgis.learn` Python API supports model extensibility through various classes, including `TextClassifier`, `EntityRecognizer`, and `SequenceToSequence`. To utilize your custom `.dlpk` file for inference with these classes, follow the steps below. The example provided demonstrates how to use the `TextClassifier` class, but you can apply similar steps for the other supported classes.\n",
491499
"\n",
492-
"## Example with TextClassifier\n"
500+
"### Example with TextClassifier\n"
493501
]
494502
},
495503
{
@@ -539,7 +547,7 @@
539547
"id": "c05c73fc",
540548
"metadata": {},
541549
"source": [
542-
"# Utilizing Custom Models with the Text Analysis Toolset in ArcGIS Pro\n",
550+
"## Utilizing Custom Models with the Text Analysis Toolset in ArcGIS Pro\n",
543551
"\n",
544552
"The Text Analysis Toolset, part of the GeoAI toolbox in ArcGIS Pro, supports model extensibility through a variety of advanced tools. These tools include:\n",
545553
"\n",
@@ -630,16 +638,16 @@
630638
"id": "65ffb41a",
631639
"metadata": {},
632640
"source": [
633-
"# Conclusion\n",
641+
"## Conclusion\n",
634642
"arcgis.learn API and ArcGIS Pro's Text Analysis Toolset, part of the GeoAI Toolbox, enables model extensibility, allowing users to use custom Natural Language Processing (NLP) models into its text analysis workflows. This documentation provides a comprehensive guide on how to create, use custom .dlpk files with these tools and API."
635643
]
636644
}
637645
],
638646
"metadata": {
639647
"kernelspec": {
640-
"display_name": "Python [conda env:conda-dlenv_1] *",
648+
"display_name": "Python 3 (ipykernel)",
641649
"language": "python",
642-
"name": "conda-env-conda-dlenv_1-py"
650+
"name": "python3"
643651
},
644652
"language_info": {
645653
"codemirror_mode": {
@@ -651,7 +659,7 @@
651659
"name": "python",
652660
"nbconvert_exporter": "python",
653661
"pygments_lexer": "ipython3",
654-
"version": "3.11.8"
662+
"version": "3.11.0"
655663
}
656664
},
657665
"nbformat": 4,

0 commit comments

Comments
 (0)