def get_eval_parameters(opt, force_categories=None): evaluate = DD() if opt.eval_sampler == "beam": evaluate.bs = opt.beam_size elif opt.eval_sampler == "greedy": evaluate.bs = 1 elif opt.eval_sampler == "topk": evaluate.k = opt.topk_size evaluate.smax = opt.gen_seqlength evaluate.sample = opt.eval_sampler evaluate.numseq = opt.num_sequences evaluate.gs = opt.generate_sequences evaluate.es = opt.evaluate_sequences if opt.dataset == "atomic": if "eval_categories" in opt and force_categories is None: evaluate.categories = opt.eval_categories else: evaluate.categories = force_categories return evaluate
def get_data_parameters(opt, experiment, dataset): data = DD() if dataset == "atomic": data.categories = sorted(opt.categories) elif dataset == "conceptnet": data.rel = opt.relation_format data.trainsize = opt.training_set_size data.devversion = opt.development_set_versions_to_use data.maxe1 = opt.max_event_1_size data.maxe2 = opt.max_event_2_size return data