<jupyter_start><jupyter_text>ClassificationsExample on how to work with classifications in Azure Purview.<jupyter_code>%env PURVIEW_NAME=pvdemofm2ie-pv
# Initialise Helper Method
import json
def getJSON(raw_output):
    output = ''.join(raw_output)
    json_obj = json.loads(output)
    return json_obj
# Get Classifications
data = !pv types readTypeDefs --type "CLASSIFICATION"
data = getJSON(data)
# Number of Classifications by Creator (createdBy)
classificationsByCreator = {}
for classification in data['classificationDefs']:
    createdBy = classification['createdBy']
    if createdBy in classificationsByCreator:
        classificationsByCreator[createdBy] += 1
    else:
        classificationsByCreator[createdBy] = 1
print(classificationsByCreator)<jupyter_output>{'admin': 208, '095354ff-cae8-44ff-8120-22ec5a941b40': 2, 'f12b84af-9b2b-4bfc-8ed7-6d72f1669f78': 1}
{'fraction_non_alphanumeric': 0.096, 'fraction_numerical': 0.053714285714285714, 'mean_word_length': 5.84375, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '240602', 'license': 'MIT', 'n_tokens_mistral': 318, 'n_tokens_neox': 290, 'n_words': 62, 'path': 'samples/notebooks (plus)/classifications.ipynb', 'repo_name': 'mdrakiburrahman/purviewcli', 'size': '875'}