Moses::LanguageModelLDHT Class Reference

Inheritance diagram for Moses::LanguageModelLDHT:

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

Collaboration graph
[legend]

List of all members.

Public Member Functions

 LanguageModelLDHT ()
 LanguageModelLDHT (const std::string &path, ScoreIndexManager &manager, FactorType factorType)
 LanguageModelLDHT (ScoreIndexManager &manager, LanguageModelLDHT &copyFrom)
LDHT::Client * getClientUnsafe () const
LDHT::Client * getClientSafe ()
LDHT::Client * initTSSClient ()
virtual ~LanguageModelLDHT ()
virtual void InitializeForInput (InputType const &source)
 Called before search and collecting of translation options.
virtual void CleanUpAfterSentenceProcessing (const InputType &source)
virtual const FFStateEmptyHypothesisState (const InputType &input) const
 return the state associated with the empty hypothesis for a given sentence
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
FFStateEvaluate (const Hypothesis &hypo, const FFState *input_state, ScoreComponentCollection *score_output) 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.
FFStateEvaluateChart (const ChartHypothesis &hypo, int featureID, ScoreComponentCollection *accumulator) const
virtual void IssueRequestsFor (Hypothesis &hypo, const FFState *input_state)
float calcScoreFromState (LDHTLMState *hypo) const
void sync ()
void SetFFStateIdx (int state_idx)

Protected Attributes

boost::thread_specific_ptr
< LDHT::Client > 
m_client
std::string m_configPath
FactorType m_factorType
int m_state_idx
int m_calc_score_count
uint64_t m_start_tick


Detailed Description

Definition at line 64 of file LDHT.cpp.


Constructor & Destructor Documentation

Moses::LanguageModelLDHT::LanguageModelLDHT (  ) 

Definition at line 119 of file LDHT.cpp.

References Moses::LanguageModel::m_enableOOVFeature.

Moses::LanguageModelLDHT::LanguageModelLDHT ( const std::string &  path,
ScoreIndexManager &  manager,
FactorType  factorType 
)

Definition at line 134 of file LDHT.cpp.

References m_configPath.

Moses::LanguageModelLDHT::LanguageModelLDHT ( ScoreIndexManager &  manager,
LanguageModelLDHT copyFrom 
)

Definition at line 124 of file LDHT.cpp.

References m_calc_score_count, m_configPath, and m_factorType.

Moses::LanguageModelLDHT::~LanguageModelLDHT (  )  [virtual]

Definition at line 143 of file LDHT.cpp.


Member Function Documentation

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

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

float Moses::LanguageModelLDHT::calcScoreFromState ( LDHTLMState hypo  )  const

Definition at line 397 of file LDHT.cpp.

References Moses::LDHTLMState::clearRequestTags(), getClientUnsafe(), Moses::LDHTLMState::requestTagsBegin(), Moses::LDHTLMState::requestTagsEnd(), and Moses::LDHTLMState::setFinalised().

Referenced by Evaluate().

Here is the call graph for this function:

Here is the caller graph for this function:

void Moses::LanguageModelLDHT::CleanUpAfterSentenceProcessing ( const InputType source  )  [virtual]

Reimplemented from Moses::FeatureFunction.

Definition at line 190 of file LDHT.cpp.

References getClientSafe(), and m_start_tick.

Here is the call graph for this function:

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

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

Implements Moses::LanguageModel.

Definition at line 210 of file LDHT.cpp.

References NULL.

FFState * Moses::LanguageModelLDHT::Evaluate ( 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 370 of file LDHT.cpp.

References calcScoreFromState(), Moses::FloorScore(), Moses::Hypothesis::GetFFState(), m_state_idx, Moses::ScoreComponentCollection::PlusEquals(), state, and Moses::TransformLMScore().

Here is the call graph for this function:

FFState * Moses::LanguageModelLDHT::EvaluateChart ( const ChartHypothesis hypo,
int  featureID,
ScoreComponentCollection accumulator 
) const [virtual]

Implements Moses::StatefulFeatureFunction.

Definition at line 389 of file LDHT.cpp.

References NULL.

LDHT::Client * Moses::LanguageModelLDHT::getClientSafe (  ) 

Definition at line 151 of file LDHT.cpp.

References initTSSClient(), m_client, and NULL.

Referenced by CleanUpAfterSentenceProcessing(), and InitializeForInput().

Here is the call graph for this function:

Here is the caller graph for this function:

LDHT::Client * Moses::LanguageModelLDHT::getClientUnsafe (  )  const

Definition at line 159 of file LDHT.cpp.

References m_client.

Referenced by CalcScore(), CalcScoreFromCache(), calcScoreFromState(), IssueRequestsFor(), and sync().

Here is the caller graph for this function:

void Moses::LanguageModelLDHT::InitializeForInput ( InputType const &  source  )  [virtual]

Called before search and collecting of translation options.

Reimplemented from Moses::FeatureFunction.

Definition at line 184 of file LDHT.cpp.

References getClientSafe(), and m_start_tick.

Here is the call graph for this function:

LDHT::Client * Moses::LanguageModelLDHT::initTSSClient (  ) 

Definition at line 164 of file LDHT.cpp.

References m_configPath.

Referenced by getClientSafe().

Here is the caller graph for this function:

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

void Moses::LanguageModelLDHT::SetFFStateIdx ( int  state_idx  )  [virtual]

Reimplemented from Moses::LanguageModel.

Definition at line 365 of file LDHT.cpp.

References m_state_idx.

void Moses::LanguageModelLDHT::sync (  )  [virtual]

Reimplemented from Moses::LanguageModel.

Definition at line 359 of file LDHT.cpp.

References getClientUnsafe(), and m_calc_score_count.

Referenced by CalcScore(), and CalcScoreFromCache().

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 107 of file LDHT.cpp.

Referenced by CalcScore(), LanguageModelLDHT(), and sync().

boost::thread_specific_ptr<LDHT::Client> Moses::LanguageModelLDHT::m_client [protected]

Definition at line 103 of file LDHT.cpp.

Referenced by getClientSafe(), and getClientUnsafe().

std::string Moses::LanguageModelLDHT::m_configPath [protected]

Definition at line 104 of file LDHT.cpp.

Referenced by initTSSClient(), and LanguageModelLDHT().

Definition at line 105 of file LDHT.cpp.

Referenced by CalcScore(), CalcScoreFromCache(), IssueRequestsFor(), and LanguageModelLDHT().

Definition at line 108 of file LDHT.cpp.

Referenced by CleanUpAfterSentenceProcessing(), and InitializeForInput().

Definition at line 106 of file LDHT.cpp.

Referenced by Evaluate(), IssueRequestsFor(), and SetFFStateIdx().


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

Generated on Thu Jun 4 00:32:18 2015 for Moses by  doxygen 1.5.9