Moses::InMemoryPerSentenceOnDemandLM Class Reference

#include <InMemoryPerSentenceOnDemandLM.h>

Inheritance diagram for Moses::InMemoryPerSentenceOnDemandLM:

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

Collaboration graph
[legend]

List of all members.

Public Member Functions

 InMemoryPerSentenceOnDemandLM (const std::string &line)
 ~InMemoryPerSentenceOnDemandLM ()
void InitializeForInput (ttasksptr const &ttask)
 Called before search and collecting of translation options.
virtual void SetParameter (const std::string &key, const std::string &value)
virtual const FFStateEmptyHypothesisState (const InputType &input) const
 return the state associated with the empty hypothesis for a given sentence
virtual FFStateEvaluateWhenApplied (const Hypothesis &hypo, const FFState *ps, ScoreComponentCollection *out) 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 &cur_hypo, int featureID, ScoreComponentCollection *accumulator) const
virtual FFStateEvaluateWhenApplied (const Syntax::SHyperedge &hyperedge, int featureID, ScoreComponentCollection *accumulator) const
virtual void CalcScore (const Phrase &phrase, float &fullScore, float &ngramScore, std::size_t &oovCount) const
virtual void CalcScoreFromCache (const Phrase &phrase, float &fullScore, float &ngramScore, std::size_t &oovCount) const
virtual void IssueRequestsFor (Hypothesis &hypo, const FFState *input_state)
virtual void sync ()
virtual void SetFFStateIdx (int state_idx)
virtual void IncrementalCallback (Incremental::Manager &manager) const
virtual void ReportHistoryOrder (std::ostream &out, const Phrase &phrase) const
virtual void EvaluateInIsolation (const Phrase &source, const TargetPhrase &targetPhrase, ScoreComponentCollection &scoreBreakdown, ScoreComponentCollection &estimatedScores) const
bool IsUseable (const FactorMask &mask) const

Protected Member Functions

LanguageModelKen
< lm::ngram::ProbingModel > & 
GetPerThreadLM () const
bool isInitialized () const

Protected Attributes

boost::thread_specific_ptr
< LanguageModelKen
< lm::ngram::ProbingModel > > 
m_perThreadLM
boost::thread_specific_ptr
< std::string > 
m_tmpFilename
FactorType m_factorType


Detailed Description

Definition at line 29 of file InMemoryPerSentenceOnDemandLM.h.


Constructor & Destructor Documentation

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

Definition at line 20 of file InMemoryPerSentenceOnDemandLM.cpp.

References Moses::FeatureFunction::ReadParameters().

Here is the call graph for this function:

Moses::InMemoryPerSentenceOnDemandLM::~InMemoryPerSentenceOnDemandLM (  ) 

Definition at line 25 of file InMemoryPerSentenceOnDemandLM.cpp.


Member Function Documentation

virtual void Moses::InMemoryPerSentenceOnDemandLM::CalcScore ( const Phrase phrase,
float &  fullScore,
float &  ngramScore,
std::size_t &  oovCount 
) const [inline, virtual]

Implements Moses::LanguageModel.

Definition at line 74 of file InMemoryPerSentenceOnDemandLM.h.

References Moses::LanguageModelKen< Model >::CalcScore(), GetPerThreadLM(), isInitialized(), and UTIL_THROW.

Here is the call graph for this function:

virtual void Moses::InMemoryPerSentenceOnDemandLM::CalcScoreFromCache ( const Phrase phrase,
float &  fullScore,
float &  ngramScore,
std::size_t &  oovCount 
) const [inline, virtual]

Reimplemented from Moses::LanguageModel.

Definition at line 82 of file InMemoryPerSentenceOnDemandLM.h.

References Moses::LanguageModel::CalcScoreFromCache(), GetPerThreadLM(), isInitialized(), and UTIL_THROW.

Here is the call graph for this function:

virtual const FFState* Moses::InMemoryPerSentenceOnDemandLM::EmptyHypothesisState ( const InputType input  )  const [inline, virtual]

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

Implements Moses::LanguageModel.

Definition at line 41 of file InMemoryPerSentenceOnDemandLM.h.

References Moses::LanguageModelKen< Model >::EmptyHypothesisState(), GetPerThreadLM(), and isInitialized().

Here is the call graph for this function:

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

Reimplemented from Moses::LanguageModel.

Definition at line 130 of file InMemoryPerSentenceOnDemandLM.h.

References Moses::LanguageModel::EvaluateInIsolation(), GetPerThreadLM(), and isInitialized().

Here is the call graph for this function:

virtual FFState* Moses::InMemoryPerSentenceOnDemandLM::EvaluateWhenApplied ( const Syntax::SHyperedge hyperedge,
int  featureID,
ScoreComponentCollection accumulator 
) const [inline, virtual]

Reimplemented from Moses::StatefulFeatureFunction.

Definition at line 65 of file InMemoryPerSentenceOnDemandLM.h.

References Moses::LanguageModelKen< Model >::EvaluateWhenApplied(), GetPerThreadLM(), isInitialized(), and UTIL_THROW.

Here is the call graph for this function:

virtual FFState* Moses::InMemoryPerSentenceOnDemandLM::EvaluateWhenApplied ( const ChartHypothesis cur_hypo,
int  featureID,
ScoreComponentCollection accumulator 
) const [inline, virtual]

Implements Moses::StatefulFeatureFunction.

Definition at line 57 of file InMemoryPerSentenceOnDemandLM.h.

References Moses::LanguageModelKen< Model >::EvaluateWhenApplied(), GetPerThreadLM(), isInitialized(), and UTIL_THROW.

Here is the call graph for this function:

virtual FFState* Moses::InMemoryPerSentenceOnDemandLM::EvaluateWhenApplied ( const Hypothesis cur_hypo,
const FFState prev_state,
ScoreComponentCollection accumulator 
) const [inline, 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 49 of file InMemoryPerSentenceOnDemandLM.h.

References Moses::LanguageModelKen< Model >::EvaluateWhenApplied(), GetPerThreadLM(), isInitialized(), and UTIL_THROW.

Here is the call graph for this function:

LanguageModelKen< lm::ngram::ProbingModel > & Moses::InMemoryPerSentenceOnDemandLM::GetPerThreadLM (  )  const [protected]

virtual void Moses::InMemoryPerSentenceOnDemandLM::IncrementalCallback ( Incremental::Manager manager  )  const [inline, virtual]

Reimplemented from Moses::LanguageModel.

Definition at line 114 of file InMemoryPerSentenceOnDemandLM.h.

References GetPerThreadLM(), Moses::LanguageModelKen< Model >::IncrementalCallback(), isInitialized(), and UTIL_THROW.

Here is the call graph for this function:

void Moses::InMemoryPerSentenceOnDemandLM::InitializeForInput ( ttasksptr const &  ttask  )  [virtual]

Called before search and collecting of translation options.

Reimplemented from Moses::FeatureFunction.

Definition at line 29 of file InMemoryPerSentenceOnDemandLM.cpp.

References GetPerThreadLM(), key, and m_tmpFilename.

Here is the call graph for this function:

bool Moses::InMemoryPerSentenceOnDemandLM::isInitialized (  )  const [inline, protected]

virtual void Moses::InMemoryPerSentenceOnDemandLM::IssueRequestsFor ( Hypothesis hypo,
const FFState input_state 
) [inline, virtual]

Reimplemented from Moses::LanguageModel.

Definition at line 90 of file InMemoryPerSentenceOnDemandLM.h.

References GetPerThreadLM(), isInitialized(), Moses::LanguageModel::IssueRequestsFor(), and UTIL_THROW.

Here is the call graph for this function:

bool Moses::InMemoryPerSentenceOnDemandLM::IsUseable ( const FactorMask mask  )  const [inline, virtual]

Implements Moses::FeatureFunction.

Definition at line 141 of file InMemoryPerSentenceOnDemandLM.h.

References m_factorType.

virtual void Moses::InMemoryPerSentenceOnDemandLM::ReportHistoryOrder ( std::ostream &  out,
const Phrase phrase 
) const [inline, virtual]

Reimplemented from Moses::LanguageModel.

Definition at line 122 of file InMemoryPerSentenceOnDemandLM.h.

References GetPerThreadLM(), isInitialized(), Moses::LanguageModelKen< Model >::ReportHistoryOrder(), and UTIL_THROW.

Here is the call graph for this function:

virtual void Moses::InMemoryPerSentenceOnDemandLM::SetFFStateIdx ( int  state_idx  )  [inline, virtual]

Reimplemented from Moses::LanguageModel.

Definition at line 106 of file InMemoryPerSentenceOnDemandLM.h.

References GetPerThreadLM(), isInitialized(), Moses::LanguageModel::SetFFStateIdx(), and UTIL_THROW.

Here is the call graph for this function:

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

Reimplemented from Moses::LanguageModel.

Definition at line 37 of file InMemoryPerSentenceOnDemandLM.h.

References GetPerThreadLM(), and Moses::LanguageModel::SetParameter().

Here is the call graph for this function:

virtual void Moses::InMemoryPerSentenceOnDemandLM::sync (  )  [inline, virtual]

Reimplemented from Moses::LanguageModel.

Definition at line 98 of file InMemoryPerSentenceOnDemandLM.h.

References GetPerThreadLM(), isInitialized(), Moses::LanguageModel::sync(), and UTIL_THROW.

Here is the call graph for this function:


Member Data Documentation

Definition at line 153 of file InMemoryPerSentenceOnDemandLM.h.

Referenced by IsUseable().

boost::thread_specific_ptr<LanguageModelKen<lm::ngram::ProbingModel> > Moses::InMemoryPerSentenceOnDemandLM::m_perThreadLM [mutable, protected]

Definition at line 150 of file InMemoryPerSentenceOnDemandLM.h.

Referenced by GetPerThreadLM().

boost::thread_specific_ptr<std::string> Moses::InMemoryPerSentenceOnDemandLM::m_tmpFilename [mutable, protected]


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

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