Skip to content

Commit a78b3a4

Browse files
authored
minor fixes (Esri#612)
* minor fixes * minor fixes
1 parent 905be1b commit a78b3a4

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

samples/04_gis_analysts_data_scientists/information-extraction-from-madison-city-crime-incident-reports-using-deep-learning.ipynb

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,7 +1030,7 @@
10301030
"metadata": {},
10311031
"outputs": [],
10321032
"source": [
1033-
"report_list=read_zip_file(reports_path) #list of new documents on which predictions are to be made."
1033+
"report_list = read_zip_file(reports_path) #list of new documents on which predictions are to be made."
10341034
]
10351035
},
10361036
{
@@ -1187,9 +1187,9 @@
11871187
"cell_type": "markdown",
11881188
"metadata": {},
11891189
"source": [
1190-
"# Publishing the results as feature layer\n",
1190+
"# Publishing the results as a feature layer\n",
11911191
"\n",
1192-
"Let's use `arcgis.geocoding` to get geo locations from the extracted address and publish the results as a feature layer."
1192+
"The code below geocodes the extracted address and publishes the results as a feature layer."
11931193
]
11941194
},
11951195
{
@@ -1211,9 +1211,9 @@
12111211
" batch_geo_codes = []\n",
12121212
" for i,item in enumerate(batch):\n",
12131213
" if isinstance(item,dict):\n",
1214-
" if (item['score']>90 and \n",
1215-
" item['address']!= f'{city}, {region}'\n",
1216-
" and item['attributes']['city']==f'{city}'):\n",
1214+
" if (item['score'] > 90 and \n",
1215+
" item['address'] != f'{city}, {region}'\n",
1216+
" and item['attributes']['city'] == f'{city}'):\n",
12171217
" batch_geo_codes.append(item['location'])\n",
12181218
" else:\n",
12191219
" batch_geo_codes.append('') \n",
@@ -1237,15 +1237,15 @@
12371237
" processed_df['geo_codes_y'] = 'y'\n",
12381238
" for i,geo_code in processed_df['geo_codes'].iteritems():\n",
12391239
" if geo_code == '': \n",
1240-
" processed_df.drop(i,inplace=True) #dropping rows with empty location\n",
1240+
" processed_df.drop(i, inplace=True) #dropping rows with empty location\n",
12411241
" else:\n",
1242-
" processed_df['geo_codes_x'].loc[i]=geo_code.get('x')\n",
1243-
" processed_df['geo_codes_y'].loc[i]=geo_code.get('y')\n",
1242+
" processed_df['geo_codes_x'].loc[i] = geo_code.get('x')\n",
1243+
" processed_df['geo_codes_y'].loc[i] = geo_code.get('y')\n",
12441244
" \n",
12451245
" sdf = processed_df.reset_index(drop=True)\n",
12461246
" sdf['geo_x_y'] = sdf['geo_codes_x'].astype('str') + ',' +sdf['geo_codes_y'].astype('str')\n",
12471247
" sdf = pd.DataFrame.spatial.from_df(sdf, address_column='geo_x_y') #adding geometry to the dataframe\n",
1248-
" sdf.drop(['geo_codes_x','geo_codes_y','geo_x_y','geo_codes'],axis=1,inplace=True) #dropping redundant columns\n",
1248+
" sdf.drop(['geo_codes_x','geo_codes_y','geo_x_y','geo_codes'], axis=1, inplace=True) #dropping redundant columns\n",
12491249
" return sdf"
12501250
]
12511251
},
@@ -1453,7 +1453,7 @@
14531453
"source": [
14541454
"# Conclusion\n",
14551455
"\n",
1456-
"We have demonstrated how `EntityRecognizer()` from `arcgis.learn` can be used for information extraction from crime incident reports. Which is an essential requirement for crime analysis. Then, we see how can this information be geo coded and visualized on a map for further analysis."
1456+
"This sample demonstrates how `EntityRecognizer()` from `arcgis.learn` can be used for information extraction from crime incident reports, which is an essential requirement for crime analysis. Then, we see how can this information be geocoded and visualized on a map for further analysis."
14571457
]
14581458
},
14591459
{

0 commit comments

Comments
 (0)