import json

# ==== 在这里自定义输入输出路径 ====
input_json_path = 
output_json_path = 

def find_discrepant_ids(json_path):
    with open(json_path, 'r', encoding='utf-8') as f:
        data = json.load(f)

    result_ids = []
    for item in data:
        label = item.get("label")
        # 新增条件：label为"A=B"时跳过
        if label == "A=B":
            continue
        jr = item.get("judge result")
        jt = item.get("judge_thinking_result")
        if jr != label and jt != label:
            result_ids.append(item.get("id"))
    return result_ids

if __name__ == "__main__":
    ids = find_discrepant_ids(input_json_path)
    # 保存为json文件
    with open(output_json_path, 'w', encoding='utf-8') as f:
        json.dump(ids, f, ensure_ascii=False, indent=2)
    print(f"共找到 {len(ids)} 条，两者都不一致且label不是'A=B'的id，已保存到 {output_json_path}")
