Multi-Agents-Debate icon indicating copy to clipboard operation
Multi-Agents-Debate copied to clipboard

How can I test the Counterintuitive QA?

Open YongLD opened this issue 1 year ago • 0 comments

Thanks for the amazing work!! I found that I can only test the zh-en with the debate4tran.py, Can I use for Counterintuitive QA or other test with config4all.json? Can you provide some runfile for me? Thanks a lot!

src_lng, tgt_lng = args.lang_pair.split('-')
    src_full = Language.make(language=src_lng).display_name()
    tgt_full = Language.make(language=tgt_lng).display_name()

    config = json.load(open(f"{MAD_path}/code/utils/config4tran.json", "r"))

    inputs = open(args.input_file, "r").readlines()
    inputs = [l.strip() for l in inputs]

    save_file_dir = args.output_dir
    if not os.path.exists(save_file_dir):
            os.mkdir(save_file_dir)

    for id, input in enumerate(tqdm(inputs)):
        # files = os.listdir(save_file_dir)
        # if f"{id}.json" in files:
        #     continue

        prompts_path = f"{save_file_dir}/{id}-config.json"

        config['source'] = input.split('\t')[0]
        config['reference'] = input.split('\t')[1]
        config['src_lng'] = src_full
        config['tgt_lng'] = tgt_full

YongLD avatar Dec 28 '23 13:12 YongLD