Last active
April 24, 2020 22:30
-
-
Save ShairozS/59b5819b304137a927c4fe2bf87dff29 to your computer and use it in GitHub Desktop.
load_nlp_data.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from arcgis.learn import prepare_data | |
| from arcgis.learn import EntityRecognizer | |
| import re | |
| import os | |
| import pandas as pd | |
| from arcgis.gis import GIS | |
| from arcgis.raster.functions import colormap | |
| from arcgis.geocoding import batch_geocode | |
| import zipfile,unicodedata | |
| from itertools import repeat | |
| ## Put the path to the downloaded or created json file from Doccano here | |
| json_path = os.path.join("data", "EntityRecognizer", "labelled_crime_reports.json") | |
| ## Create the data object to train the model | |
| data = prepare_data(path= json_path, | |
| class_mapping={'address_tag':'Address'}, | |
| dataset_type='ner_json') | |
| ## Visualize the batch | |
| data.show_batch() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment