Moses::DesegModel Class Reference

#include <DsgModel.h>

Inheritance diagram for Moses::DesegModel:

Inheritance graph
[legend]
Collaboration diagram for Moses::DesegModel:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 DesegModel (const std::string &line)
 ~DesegModel ()
void readLanguageModel (const char *)
void Load (AllOptions::ptr const &opts)
 override to load model files
FFStateEvaluateWhenApplied (const Hypothesis &cur_hypo, const FFState *prev_state, ScoreComponentCollection *accumulator) const
 This interface should be implemented. Notes: When evaluating the value of this feature function, you should avoid calling hypo.GetPrevHypo(). If you need something from the "previous" hypothesis, you should store it in an FFState object which will be passed in as prev_state. If you don't do this, you will get in trouble.
virtual FFStateEvaluateWhenApplied (const ChartHypothesis &, int, ScoreComponentCollection *accumulator) const
void EvaluateInIsolation (const Phrase &source, const TargetPhrase &targetPhrase, ScoreComponentCollection &scoreBreakdown, ScoreComponentCollection &estimatedScores) const
virtual const FFStateEmptyHypothesisState (const InputType &input) const
 return the state associated with the empty hypothesis for a given sentence
virtual std::string GetScoreProducerWeightShortName (unsigned idx=0) const
void SetParameter (const std::string &key, const std::string &value)
bool IsUseable (const FactorMask &mask) const

Public Attributes

DsgLMDSGM
DesegmenterdesegT
int tFactor
int order
int numFeatures
bool optimistic

Protected Types

typedef std::vector< float > Scores

Protected Attributes

std::string m_lmPath
std::string m_desegPath
bool m_simple


Detailed Description

Definition at line 16 of file DsgModel.h.


Member Typedef Documentation

typedef std::vector<float> Moses::DesegModel::Scores [protected]

Definition at line 57 of file DsgModel.h.


Constructor & Destructor Documentation

Moses::DesegModel::DesegModel ( const std::string &  line  ) 

Definition at line 13 of file DsgModel.cpp.

References numFeatures, optimistic, order, Moses::FeatureFunction::ReadParameters(), and tFactor.

Here is the call graph for this function:

Moses::DesegModel::~DesegModel (  ) 

Definition at line 23 of file DsgModel.cpp.

References DSGM.


Member Function Documentation

const FFState * Moses::DesegModel::EmptyHypothesisState ( const InputType input  )  const [virtual]

return the state associated with the empty hypothesis for a given sentence

Implements Moses::StatefulFeatureFunction.

Definition at line 105 of file DsgModel.cpp.

References Moses::KenDsgBase::BeginSentenceState(), DSGM, and VERBOSE.

Here is the call graph for this function:

void Moses::DesegModel::EvaluateInIsolation ( const Phrase source,
const TargetPhrase targetPhrase,
ScoreComponentCollection scoreBreakdown,
ScoreComponentCollection estimatedScores 
) const [virtual]

FFState * Moses::DesegModel::EvaluateWhenApplied ( const ChartHypothesis ,
int  ,
ScoreComponentCollection accumulator 
) const [virtual]

Implements Moses::StatefulFeatureFunction.

Definition at line 97 of file DsgModel.cpp.

References UTIL_THROW2.

FFState * Moses::DesegModel::EvaluateWhenApplied ( const Hypothesis cur_hypo,
const FFState prev_state,
ScoreComponentCollection accumulator 
) const [virtual]

This interface should be implemented. Notes: When evaluating the value of this feature function, you should avoid calling hypo.GetPrevHypo(). If you need something from the "previous" hypothesis, you should store it in an FFState object which will be passed in as prev_state. If you don't do this, you will get in trouble.

Implements Moses::StatefulFeatureFunction.

Definition at line 68 of file DsgModel.cpp.

References StringPiece::as_string(), Moses::dsgHypothesis::calculateDsgProb(), desegT, DSGM, Moses::TargetPhrase::GetAlignTerm(), Moses::Hypothesis::GetCurrSourceWordsRange(), Moses::Hypothesis::GetCurrTargetLength(), Moses::Hypothesis::GetCurrTargetPhrase(), Moses::Word::GetFactor(), Moses::Range::GetStartPos(), Moses::Factor::GetString(), Moses::Phrase::GetWord(), Moses::Hypothesis::IsSourceCompleted(), numFeatures, optimistic, Moses::ScoreComponentCollection::PlusEquals(), Moses::dsgHypothesis::populateScores(), Moses::dsgHypothesis::saveState(), Moses::dsgHypothesis::setPhrases(), Moses::dsgHypothesis::setState(), and tFactor.

Here is the call graph for this function:

std::string Moses::DesegModel::GetScoreProducerWeightShortName ( unsigned  idx = 0  )  const [virtual]

Definition at line 113 of file DsgModel.cpp.

bool Moses::DesegModel::IsUseable ( const FactorMask mask  )  const [virtual]

Implements Moses::FeatureFunction.

Definition at line 150 of file DsgModel.cpp.

void Moses::DesegModel::Load ( AllOptions::ptr const &  opts  )  [virtual]

override to load model files

Reimplemented from Moses::FeatureFunction.

Definition at line 36 of file DsgModel.cpp.

References m_lmPath, Moses::FeatureFunction::m_options, and readLanguageModel().

Here is the call graph for this function:

void Moses::DesegModel::readLanguageModel ( const char *  lmFile  ) 

Definition at line 28 of file DsgModel.cpp.

References Moses::ConstructDsgLM(), desegT, DSGM, m_desegPath, m_lmPath, m_simple, and Moses::KenDsgBase::NullContextState().

Referenced by Load().

Here is the call graph for this function:

Here is the caller graph for this function:

void Moses::DesegModel::SetParameter ( const std::string &  key,
const std::string &  value 
) [virtual]

Reimplemented from Moses::FeatureFunction.

Definition at line 119 of file DsgModel.cpp.

References m_desegPath, m_lmPath, m_simple, numFeatures, optimistic, order, and tFactor.


Member Data Documentation

Definition at line 21 of file DsgModel.h.

Referenced by EvaluateInIsolation(), EvaluateWhenApplied(), and readLanguageModel().

std::string Moses::DesegModel::m_desegPath [protected]

Definition at line 59 of file DsgModel.h.

Referenced by readLanguageModel(), and SetParameter().

std::string Moses::DesegModel::m_lmPath [protected]

Definition at line 58 of file DsgModel.h.

Referenced by Load(), readLanguageModel(), and SetParameter().

bool Moses::DesegModel::m_simple [protected]

Definition at line 60 of file DsgModel.h.

Referenced by readLanguageModel(), and SetParameter().

Definition at line 24 of file DsgModel.h.

Referenced by DesegModel(), EvaluateInIsolation(), EvaluateWhenApplied(), and SetParameter().

Definition at line 25 of file DsgModel.h.

Referenced by DesegModel(), EvaluateWhenApplied(), and SetParameter().

Definition at line 23 of file DsgModel.h.

Referenced by DesegModel(), and SetParameter().

Definition at line 22 of file DsgModel.h.

Referenced by DesegModel(), EvaluateInIsolation(), EvaluateWhenApplied(), and SetParameter().


The documentation for this class was generated from the following files:

Generated on Thu Jul 6 00:33:03 2017 for Moses by  doxygen 1.5.9