<commit_before># Writes the scores of the machine classifications back
# to Tomnod. Features classified as swimming pools are given the 
# highest priority (which is 0).
# This script was used in the adelaide_pools_2016 campaign.

import json
from mltools.json_tools as jt
from mltools.crowdsourcing import TomnodCommunicator

# contains classified features
filename = '1040010014BF5100_classified.geojson'

# get related data from file
property_names = ['class_name', 'score', 'feature_id']
data = jt.get_from_geojson(filename, property_names)  

# compute priorities
priorities = [abs(entry[1] - 0.5) for entry in data]

# add priorities to data<commit_msg>changed explanation<commit_after># Writes machine classification results back to Tomnod.
# For each classification, priority is the distance from 0.5.
# This script was used in the adelaide_pools_2016 campaign.

import json
from mltools.json_tools as jt
from mltools.crowdsourcing import TomnodCommunicator

# contains classified features
filename = '1040010014BF5100_classified.geojson'

# get related data from file
property_names = ['class_name', 'score', 'feature_id']
data = jt.get_from_geojson(filename, property_names)  

# compute priorities
priorities = [abs(entry[1] - 0.5) for entry in data]

# add priorities to data
{'fraction_non_alphanumeric': 0.07226107226107226, 'fraction_numerical': 0.03496503496503497, 'mean_word_length': 5.639175257731959, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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}}
{'dir': 'git-commits-cleaned', 'id': '4100628', 'n_tokens_mistral': 412, 'n_tokens_neox': 371, 'n_words': 137}