File size: 370 Bytes
20e4eaa |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
import sys
import json
input_file = sys.argv[1]
output_file = sys.argv[2]
with open(input_file, "r") as fin, open(output_file, "w") as fout:
data = json.load(fin)
for item in data:
prediction_units = item["prediction_units"]
if prediction_units != "":
fout.write(prediction_units + "\n")
else:
fout.write("0\n")
|