Moses::OpSequenceModel Class Reference

#include <OpSequenceModel.h>

Inheritance diagram for Moses::OpSequenceModel:

Inheritance graph
Collaboration diagram for Moses::OpSequenceModel:

Collaboration graph

List of all members.

Public Member Functions

 OpSequenceModel (const std::string &line)
 ~OpSequenceModel ()
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
std::vector< float > GetFutureScores (const Phrase &source, const Phrase &target) const
void SetParameter (const std::string &key, const std::string &value)
bool IsUseable (const FactorMask &mask) const

Public Attributes

float unkOpProb
int sFactor
int tFactor
int numFeatures
util::LoadMethod load_method

Protected Types

typedef std::pair< Phrase, PhraseParallelPhrase
typedef std::vector< float > Scores

Protected Attributes

std::map< ParallelPhrase, Scoresm_futureCost
std::vector< std::pair
< std::set< int >, std::set
< int > > > 
std::set< int > targetNullWords
std::string m_lmPath

Detailed Description

Definition at line 14 of file OpSequenceModel.h.

Member Typedef Documentation

typedef std::pair<Phrase, Phrase> Moses::OpSequenceModel::ParallelPhrase [protected]

Definition at line 56 of file OpSequenceModel.h.

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

Definition at line 57 of file OpSequenceModel.h.

Constructor & Destructor Documentation

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

Definition at line 13 of file OpSequenceModel.cpp.

References load_method, numFeatures, util::READ, Moses::FeatureFunction::ReadParameters(), sFactor, and tFactor.

Here is the call graph for this function:

Moses::OpSequenceModel::~OpSequenceModel (  ) 

Definition at line 23 of file OpSequenceModel.cpp.

References OSM.

Member Function Documentation

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

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

Implements Moses::StatefulFeatureFunction.

Definition at line 208 of file OpSequenceModel.cpp.

References Moses::KenOSMBase::BeginSentenceState(), OSM, and VERBOSE.

Here is the call graph for this function:

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

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

Implements Moses::StatefulFeatureFunction.

Definition at line 199 of file OpSequenceModel.cpp.

References UTIL_THROW2.

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

std::vector< float > Moses::OpSequenceModel::GetFutureScores ( const Phrase source,
const Phrase target 
) const

Definition at line 222 of file OpSequenceModel.cpp.

References m_futureCost, numFeatures, and unkOpProb.

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

Definition at line 217 of file OpSequenceModel.cpp.

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

Implements Moses::FeatureFunction.

Definition at line 271 of file OpSequenceModel.cpp.

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

override to load model files

Reimplemented from Moses::FeatureFunction.

Definition at line 39 of file OpSequenceModel.cpp.

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

Here is the call graph for this function:

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

Definition at line 28 of file OpSequenceModel.cpp.

References Moses::ConstructOSMLM(), load_method, m_lmPath, Moses::KenOSMBase::NullContextState(), OSM, Moses::KenOSMBase::Score(), and unkOpProb.

Referenced by Load().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Member Data Documentation

std::vector< std::pair < std::set <int> , std::set <int> > > Moses::OpSequenceModel::ceptsInPhrase [protected]

Definition at line 60 of file OpSequenceModel.h.

Definition at line 23 of file OpSequenceModel.h.

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

Definition at line 58 of file OpSequenceModel.h.

Referenced by GetFutureScores().

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

Definition at line 62 of file OpSequenceModel.h.

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

std::set<int> Moses::OpSequenceModel::targetNullWords [protected]

Definition at line 61 of file OpSequenceModel.h.

Definition at line 19 of file OpSequenceModel.h.

Referenced by GetFutureScores(), and readLanguageModel().

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

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