def _infer_restriction(project_id, _, module_params): ''' Runs the training data and infers possible restrictions that can be made on the referential. ARGUMENTS (GET): project_id: ID for "link" project ARGUMENTS (POST): - data_params: none - module_params: {#TODO: fill with params from restrict} ''' if module_params is None: module_params = dict() proj = ESLinker(project_id=project_id) training = proj.read_config_data('dedupe_linker', 'training.json') if not training: raise Exception('No training file was found in this project') module_params['training'] = training result = proj.infer('infer_restriction', module_params) # Write log proj._write_log_buffer(False) return result
def _link_results_analyzer(project_id, data_params, module_params): ''' Runs the link results analyzer module wrapper around ESNormalizer.infer ? ARGUMENTS (GET): project_id: ID for "normalize" project ARGUMENTS (POST): - data_params: { "module_name": module to fetch from "file_name": file to fetch } - (module_params): { "col_matches": dict like {"source": col_source, "ref": col_ref} A pair of columns that can be used a joining key: "lower": bool (defaults to False) Whether or not the values of the joining should be lowercased before joining } ''' if module_params is None: module_params = dict() proj = ESLinker(project_id=project_id) proj.load_data(data_params['module_name'], data_params['file_name']) result = proj.analyze_results(module_params) # Write log proj._write_log_buffer(False) return result
def _link_results_analyzer(project_id, data_params, *argv): ''' Runs the link results analyzer module wrapper around ESNormalizer.infer ? ARGUMENTS (GET): project_id: ID for "normalize" project ARGUMENTS (POST): - data_params: { "module_name": module to fetch from "file_name": file to fetch } ''' proj = ESLinker(project_id=project_id) proj.load_data(data_params['module_name'], data_params['file_name']) result = proj.infer('link_results_analyzer', {}) # Write log proj._write_log_buffer(False) return result