Initial commit

This commit is contained in:
hanluzhi0429@gmail.com
2025-04-13 09:30:46 +08:00
commit 4f8972e88a
248 changed files with 34689 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
import os
import json
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("--src", type=str)
parser.add_argument("--dst", type=str)
args = parser.parse_args()
all_answers = []
for line_idx, line in enumerate(open(args.src)):
res = json.loads(line)
question_id = res["question_id"]
text = res["text"].rstrip(".").lower()
all_answers.append({"questionId": question_id, "prediction": text})
with open(args.dst, "w") as f:
json.dump(all_answers, f)