def get_eval_metric(self, args, name="metric", ds=None): """ Returns a neurst.metrics.metric.Metric object for evaluation.""" if ds is not None and hasattr(ds, "trg_lang") and ds.trg_lang is not None: return build_metric(args[name + ".class"], language=ds.trg_lang, **args[name + ".params"]) return build_metric(args[name + ".class"], language=self._trg_data_pipeline.meta["language"], **args[name + ".params"])
def _main(_): arg_parser = flags_core.define_flags(FLAG_LIST, with_config_file=False) args, remaining_argv = flags_core.intelligent_parse_flags( FLAG_LIST, arg_parser) flags_core.verbose_flags(FLAG_LIST, args, remaining_argv) metric = build_metric(args) evaluate(metric, args["hypo_file"], args["ref_file"])
def get_eval_metric(self, args, name="metric"): """ Returns a neurst.metrics.metric.Metric object for evaluation.""" return build_metric(args[name + ".class"], language=self._trg_data_pipeline.meta["language"], **args[name + ".params"])