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

SyntacticLanguageModel.h « src « moses - github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 3497d3dc472b36e19befbe73f9859cca6150ce8e (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
//

#ifndef moses_SyntacticLanguageModel_h
#define moses_SyntacticLanguageModel_h

#include "FeatureFunction.h"


class YModel; // hidden model
class XModel; // observed model

namespace Moses
{

  template <class MH, class MO> class SyntacticLanguageModelFiles;
  
  class SyntacticLanguageModel : public StatefulFeatureFunction {

  public:

    SyntacticLanguageModel(const std::vector<std::string>& filePaths,
			   const std::vector<float>& weights,
			   const FactorType factorType,
			   const size_t beamWidth);

    ~SyntacticLanguageModel();

    size_t GetNumScoreComponents() const;
    std::string GetScoreProducerDescription(unsigned) const;
    std::string GetScoreProducerWeightShortName(unsigned) const;

    const FFState* EmptyHypothesisState(const InputType &input) const;

    FFState* Evaluate(const Hypothesis& cur_hypo,
		      const FFState* prev_state,
		      ScoreComponentCollection* accumulator) const;

    //    double perplexity();

  private:

    const size_t m_NumScoreComponents;
    SyntacticLanguageModelFiles<YModel,XModel>* m_files;
    const FactorType m_factorType;
    const size_t m_beamWidth;

  };


}

#endif