def METHOD_NAME():
    args = parse_arguments()
    raw_data = {}
    raw_data["train"] = load_data_from_eli5_file(args.train_file)
    raw_data["dev"] = load_data_from_eli5_file(args.eval_file)
    if args.test_file:
        raw_data["test"] = load_data_from_eli5_file(args["test_file"])
    if not os.path.exists(args.output_dir):
        os.makedirs(args.output_dir)
    search_result_location_by_split = get_search_results_location_by_split(args.search_result_location)
    c_passages,c_titles = load_corpus(args.collection)
    for split in raw_data:
        dt = raw_data[split]
        split_qids_to_hits= {}
        for loc in search_result_location_by_split[split]:
            qids_to_hits = load_ranking_file(os.path.join(loc, "ranked_passages.tsv"))    
            split_qids_to_hits.update(qids_to_hits)
        for ex in dt:
            ex_id = ex['id']
            ex_passages = []
            if ex_id in split_qids_to_hits:
                hits = split_qids_to_hits[ex_id]
                for hit in hits:
                    hit['title'] = c_titles[int(hit['passage_id'])]
                    hit['text'] = c_passages[int(hit['passage_id'])]
                    ex_passages.append(hit)
            ex['passages'] = ex_passages
        with jsonlines.open(os.path.join(args.output_dir, split+".json"), 'w') as writer:
            writer.write_all(dt)