in model/utils/disambiguator_evaluation.py [0:0]
def main(args):
print("Reading: {}".format(args["data_json_path"]))
with open(args["data_json_path"], "r") as file_id:
gt_labels = json.load(file_id)
print("Reading: {}".format(args["model_result_path"]))
with open(args["model_result_path"], "r") as file_id:
model_results = json.load(file_id)
if args["record_instance_results"]:
instance_results_path = args["model_result_path"].replace(
".json", "_results.json"
)
else:
instance_results_path = None
accuracy, accuracy_std_err = evaluate_disambiguation(
gt_labels, model_results, record_instance_results=instance_results_path
)
print(f"Disambiguation Accuracy: {accuracy:.3f} +- {accuracy_std_err:.3f}")