#include <SearchNormalBatch.h>
Public Member Functions | |
SearchNormalBatch (Manager &manager, const InputType &source, const TranslationOptionCollection &transOptColl) | |
~SearchNormalBatch () | |
void | Decode () |
Protected Member Functions | |
void | ExpandHypothesis (const Hypothesis &hypothesis, const TranslationOption &transOpt, float expectedScore) |
void | EvalAndMergePartialHypos () |
Protected Attributes | |
std::vector< const StatelessFeatureFunction * > | m_stateless_ffs |
std::map< int, LanguageModel * > | m_dlm_ffs |
std::map< int, StatefulFeatureFunction * > | m_stateful_ffs |
std::vector< Hypothesis * > | m_partial_hypos |
uint32_t | m_batch_size |
int | m_max_stack_size |
Definition at line 18 of file SearchNormalBatch.h.
Moses::SearchNormalBatch::SearchNormalBatch | ( | Manager & | manager, | |
const InputType & | source, | |||
const TranslationOptionCollection & | transOptColl | |||
) |
Definition at line 13 of file SearchNormalBatch.cpp.
References Moses::StaticData::GetMaxHypoStackSize(), Moses::StatefulFeatureFunction::GetStatefulFeatureFunctions(), Moses::StatelessFeatureFunction::GetStatelessFeatureFunctions(), Moses::StaticData::Instance(), m_dlm_ffs, m_max_stack_size, m_stateful_ffs, and m_stateless_ffs.
Moses::SearchNormalBatch::~SearchNormalBatch | ( | ) |
Definition at line 35 of file SearchNormalBatch.cpp.
void Moses::SearchNormalBatch::Decode | ( | ) | [virtual] |
Main decoder loop that translates a sentence by expanding hypotheses stack by stack, until the end of the sentence.
Reimplemented from Moses::SearchNormal.
Definition at line 43 of file SearchNormalBatch.cpp.
References Moses::SearchNormal::actual_hypoStack, Moses::HypothesisStack::begin(), Moses::HypothesisStackNormal::CleanupArcList(), Moses::Hypothesis::Create(), Moses::HypothesisStack::end(), EvalAndMergePartialHypos(), Moses::StaticData::GetMaxHypoStackSize(), Moses::Manager::GetSentenceStats(), Moses::StaticData::GetTimeoutThreshold(), Moses::GetUserTime(), IFVERBOSE, Moses::StaticData::Instance(), Moses::SearchNormal::interrupted_flag, Moses::SearchNormal::m_hypoStackColl, Moses::Search::m_initialTransOpt, Moses::Search::m_manager, Moses::SearchNormal::m_source, Moses::SearchNormal::OutputHypoStackSize(), Moses::SearchNormal::ProcessOneHypothesis(), Moses::HypothesisStackNormal::PruneToSize(), Moses::SentenceStats::StartTimeStack(), Moses::stats, Moses::SentenceStats::StopTimeStack(), and VERBOSE.
void Moses::SearchNormalBatch::EvalAndMergePartialHypos | ( | ) | [protected] |
Definition at line 147 of file SearchNormalBatch.cpp.
References Moses::Hypothesis::EvaluateWhenApplied(), Moses::WordsBitmap::GetNumWordsCovered(), Moses::Hypothesis::GetWordsBitmap(), m_dlm_ffs, Moses::SearchNormal::m_hypoStackColl, m_max_stack_size, m_partial_hypos, m_stateful_ffs, m_stateless_ffs, and Moses::HypothesisStackNormal::PruneToSize().
Referenced by Decode(), and ExpandHypothesis().
void Moses::SearchNormalBatch::ExpandHypothesis | ( | const Hypothesis & | hypothesis, | |
const TranslationOption & | transOpt, | |||
float | expectedScore | |||
) | [protected, virtual] |
Expand one hypothesis with a translation option. this involves initial creation, scoring and adding it to the proper stack
hypothesis | hypothesis to be expanded upon | |
transOpt | translation option (phrase translation) that is applied to create the new hypothesis | |
expectedScore | base score for early discarding (base hypothesis score plus future score estimation) |
Reimplemented from Moses::SearchNormal.
Definition at line 108 of file SearchNormalBatch.cpp.
References Moses::Hypothesis::CreateNext(), EvalAndMergePartialHypos(), Moses::Hypothesis::GetFFState(), Moses::Hypothesis::GetPrevHypo(), Moses::Manager::GetSentenceStats(), IFVERBOSE, Moses::StaticData::Instance(), m_batch_size, m_dlm_ffs, Moses::Search::m_manager, m_partial_hypos, NULL, Moses::SentenceStats::StartTimeBuildHyp(), Moses::stats, Moses::SentenceStats::StopTimeBuildHyp(), Moses::StaticData::UseEarlyDiscarding(), and UTIL_THROW2.
uint32_t Moses::SearchNormalBatch::m_batch_size [protected] |
std::map<int, LanguageModel*> Moses::SearchNormalBatch::m_dlm_ffs [protected] |
Definition at line 24 of file SearchNormalBatch.h.
Referenced by EvalAndMergePartialHypos(), ExpandHypothesis(), and SearchNormalBatch().
int Moses::SearchNormalBatch::m_max_stack_size [protected] |
Definition at line 28 of file SearchNormalBatch.h.
Referenced by EvalAndMergePartialHypos(), and SearchNormalBatch().
std::vector<Hypothesis*> Moses::SearchNormalBatch::m_partial_hypos [protected] |
Definition at line 26 of file SearchNormalBatch.h.
Referenced by EvalAndMergePartialHypos(), and ExpandHypothesis().
std::map<int, StatefulFeatureFunction*> Moses::SearchNormalBatch::m_stateful_ffs [protected] |
Definition at line 25 of file SearchNormalBatch.h.
Referenced by EvalAndMergePartialHypos(), and SearchNormalBatch().
std::vector<const StatelessFeatureFunction*> Moses::SearchNormalBatch::m_stateless_ffs [protected] |
Definition at line 23 of file SearchNormalBatch.h.
Referenced by EvalAndMergePartialHypos(), and SearchNormalBatch().