Ejemplo n.º 1
0
                           nargs='*',
                           help="Run only the specified experiments")
    argparser.set_defaults(generate_doc=False)
    args = argparser.parse_args()

    config_parser = OptionParser()
    config_parser.add_task("preproc", xnmt_preproc.options)
    config_parser.add_task("train", xnmt_train.options)
    config_parser.add_task("decode", xnmt_decode.options)
    config_parser.add_task("evaluate", xnmt_evaluate.options)

    # Tweak the options to make config files less repetitive:
    # - Delete evaluate:evaluator, replace with exp:eval_metrics
    # - Delete decode:hyp_file, evaluate:hyp_file, replace with exp:hyp_file
    # - Delete train:model, decode:model_file, replace with exp:model_file
    config_parser.remove_option("evaluate", "evaluator")
    config_parser.remove_option("decode", "trg_file")
    config_parser.remove_option("evaluate", "hyp_file")
    config_parser.remove_option("train", "model_file")
    config_parser.remove_option("decode", "model_file")

    experiment_options = [
        Option("model_file",
               default_value="<EXP>.mod",
               help_str="Location to write the model file"),
        Option("hyp_file",
               default_value="<EXP>.hyp",
               help_str="Location to write decoded output for evaluation"),
        Option("out_file",
               default_value="<EXP>.out",
               help_str="Location to write stdout messages"),