import json

def replace_keywords_in_json(input_path, output_path):
    # 读取 JSON 文件
    with open(input_path, 'r', encoding='utf-8') as f:
        data = f.read()
    
    # 进行关键词替换
    data = data.replace('"label": "A<B"', '"label": "B>A"')
    
    # 将替换后的内容写入新文件
    with open(output_path, 'w', encoding='utf-8') as f:
        f.write(data)

    print(f"替换完成，输出文件已保存到：{output_path}")

# 示例调用（修改为你自己的文件路径）
if __name__ == "__main__":
    input_path =    # 输入文件路径，例如 "data/input.json"
    output_path =  # 输出文件路径，例如 "data/output.json"
    replace_keywords_in_json(input_path, output_path)
