####### 这份代码的作用是只保留"id"，"judge_thinking"，"judge_response"和"judge result"这四个关键词及其对应的内容
import json

# ===== 自定义输入输出文件路径 =====
input_file =     # 你的原始 JSON 文件路径
output_file =    # 保存新 JSON 文件的路径

# ===== 读取原始 JSON 文件 =====
with open(input_file, 'r', encoding='utf-8') as f:
    data = json.load(f)

# ===== 处理数据 =====
new_data = []
for item in data:
    filtered_item = {
        "id": item.get("id"),
        "judge_thinking": item.get("judge_thinking"),
        "judge_response": item.get("judge_response"),
        "judge result": item.get("judge result")
    }
    new_data.append(filtered_item)

# ===== 保存新 JSON 文件 =====
with open(output_file, 'w', encoding='utf-8') as f:
    json.dump(new_data, f, ensure_ascii=False, indent=4)

print(f"处理完成，新文件已保存至: {output_file}")
