Unverified Commit 9e7bc51b authored by tguens's avatar tguens Committed by GitHub
Browse files

Update run_squad.py

Indentation change so that the output "nbest_predictions.json" is not empty.
parent 3fc63f12
...@@ -617,7 +617,7 @@ def write_predictions(all_examples, all_features, all_results, n_best_size, ...@@ -617,7 +617,7 @@ def write_predictions(all_examples, all_features, all_results, n_best_size,
all_predictions[example.qas_id] = "" all_predictions[example.qas_id] = ""
else: else:
all_predictions[example.qas_id] = best_non_null_entry.text 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: with open(output_prediction_file, "w") as writer:
writer.write(json.dumps(all_predictions, indent=4) + "\n") writer.write(json.dumps(all_predictions, indent=4) + "\n")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment