Skip to content

Instantly share code, notes, and snippets.

@ShairozS
Last active April 24, 2020 22:30
Show Gist options
  • Select an option

  • Save ShairozS/59b5819b304137a927c4fe2bf87dff29 to your computer and use it in GitHub Desktop.

Select an option

Save ShairozS/59b5819b304137a927c4fe2bf87dff29 to your computer and use it in GitHub Desktop.
load_nlp_data.py
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