(eval_examples, extra_data, all_results)
| 72 | |
| 73 | |
| 74 | def postprocess(eval_examples, extra_data, all_results): |
| 75 | output_dir = 'predictions' |
| 76 | os.makedirs(output_dir, exist_ok=True) |
| 77 | output_prediction_file = os.path.join(output_dir, "predictions.json") |
| 78 | output_nbest_file = os.path.join(output_dir, "nbest_predictions.json") |
| 79 | write_predictions(eval_examples, extra_data, all_results, n_best_size, |
| 80 | max_answer_length, True, output_prediction_file, |
| 81 | output_nbest_file) |
| 82 | |
| 83 | # print results |
| 84 | with open(output_prediction_file) as json_file: |
| 85 | test_data = json.load(json_file) |
| 86 | print("The result is:", json.dumps(test_data, indent=2)) |
| 87 | |
| 88 | |
| 89 | class MyModel(sonnx.SONNXModel): |
no test coverage detected