Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I test the Counterintuitive QA? #6

Open
YongLD opened this issue Dec 28, 2023 · 0 comments
Open

How can I test the Counterintuitive QA? #6

YongLD opened this issue Dec 28, 2023 · 0 comments

Comments

@YongLD
Copy link

YongLD commented Dec 28, 2023

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant