Welcome to mirror list, hosted at ThFree Co, Russian Federation.

LMBR_Options.cpp « parameters « moses - github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e3b5d038d26ec9b467e67b3f7370a65321864457 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// -*- mode: c++; indent-tabs-mode: nil; tab-width: 2 -*-
#include "LMBR_Options.h"

namespace Moses {

  LMBR_Options::
  LMBR_Options() 
    : enabled(false)
    , use_lattice_hyp_set(false)
    , precision(0.8f)
    , ratio(0.6f)
    , map_weight(0.8f)
    , pruning_factor(30)
  { }

  bool
  LMBR_Options::
  init(Parameter const& param)
  {
    param.SetParameter(enabled, "lminimum-bayes-risk", false);
    
    param.SetParameter(ratio, "lmbr-r", 0.6f);
    param.SetParameter(precision, "lmbr-p", 0.8f);
    param.SetParameter(map_weight, "lmbr-map-weight", 0.0f);
    param.SetParameter(pruning_factor, "lmbr-pruning-factor", size_t(30));
    param.SetParameter(use_lattice_hyp_set, "lattice-hypo-set", false);
    
    PARAM_VEC const* params = param.GetParam("lmbr-thetas");
    if (params) theta = Scan<float>(*params);
    
    return true;
  }




}