From 9e7bc51b95118528bb6c394d02c341cb5401e25d Mon Sep 17 00:00:00 2001 From: tguens <50817608+tguens@users.noreply.github.com> Date: Wed, 22 May 2019 17:27:59 +0800 Subject: [PATCH] Update run_squad.py Indentation change so that the output "nbest_predictions.json" is not empty. --- examples/run_squad.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/run_squad.py b/examples/run_squad.py index 249aff7f8a..9f76fb8fbb 100644 --- a/examples/run_squad.py +++ b/examples/run_squad.py @@ -617,7 +617,7 @@ def write_predictions(all_examples, all_features, all_results, n_best_size, all_predictions[example.qas_id] = "" else: all_predictions[example.qas_id] = best_non_null_entry.text - all_nbest_json[example.qas_id] = nbest_json + all_nbest_json[example.qas_id] = nbest_json with open(output_prediction_file, "w") as writer: writer.write(json.dumps(all_predictions, indent=4) + "\n")