MCPcopy Create free account
hub / github.com/DataArcTech/ToG / save_result2json

Function save_result2json

eval/utils.py:129–138  ·  view source on GitHub ↗
(dataset_name, num_right, num_error, total_nums, method)

Source from the content-addressed store, hash-verified

127 return False
128
129def save_result2json(dataset_name, num_right, num_error, total_nums, method):
130 results_data = {
131 'dataset': dataset_name,
132 'method': method,
133 'Exact Match': float(num_right/total_nums),
134 'Right Samples': num_right,
135 'Error Sampels': num_error
136 }
137 with open('ToG_{}_results.json'.format(dataset_name), 'w', encoding='utf-8') as f:
138 json.dump(results_data, f, ensure_ascii=False, indent=4)
139
140def extract_content(s):
141 matches = re.findall(r'\{(.*?)\}', s)

Callers 1

eval.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected