MCPcopy Create free account
hub / github.com/debjitpaul/refiner / write_t5_predictions

Function write_t5_predictions

src/data_processing/processor.py:75–82  ·  view source on GitHub ↗

Write final predictions to the json file and log-odds of null if needed.

(predictions, output_nbest_file, qa_ids)

Source from the content-addressed store, hash-verified

73 return dataset, labels
74
75def write_t5_predictions(predictions, output_nbest_file, qa_ids):
76 """Write final predictions to the json file and log-odds of null if needed."""
77 logging.info("Writing predictions to: %s" % (output_nbest_file))
78 nbest_json = {}
79 for (qa_id, prediction) in zip(qa_ids, predictions):
80 nbest_json[qa_id] = prediction
81 with open(output_nbest_file, "w") as writer:
82 writer.write(json.dumps(nbest_json, indent=2) + "\n")

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected