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

SearchOptions.h « parameters « moses - github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 30a612f051fae75e98533cfbb3dfead95bee34b3 (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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// -*- mode: c++; indent-tabs-mode: nil; tab-width: 2 -*-
#pragma once
#include <string>
#include "moses/Parameter.h"
#include "OptionsBaseClass.h"
namespace Moses
{

  bool is_syntax(SearchAlgorithm algo);
  
  struct 
  SearchOptions : public OptionsBaseClass
  {
    SearchAlgorithm algo;
    
    // stack decoding
    size_t stack_size;       // maxHypoStackSize;
    size_t stack_diversity;  // minHypoStackDiversity;
    bool disable_discarding; 
    // Disable discarding of bad hypotheses from HypothesisStackNormal
    size_t max_phrase_length;
    size_t max_trans_opt_per_cov; 
    size_t max_partial_trans_opt;
    // beam search
    float beam_width;

    int timeout;
    int segment_timeout;

    bool consensus; //! Use Consensus decoding  (DeNero et al 2009)
    
    // reordering options
    // bool  reorderingConstraint; //! use additional reordering constraints
    // bool  useEarlyDistortionCost;

    float early_discarding_threshold;
    float trans_opt_threshold;

    bool init(Parameter const& param);
    SearchOptions(Parameter const& param);
    SearchOptions();

    bool 
    UseEarlyDiscarding() const {
      return early_discarding_threshold != -std::numeric_limits<float>::infinity();
    }

    bool 
    update(std::map<std::string,xmlrpc_c::value>const& params);

  };

}