Moses::SearchNormal Class Reference

#include <SearchNormal.h>

Inheritance diagram for Moses::SearchNormal:

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

Collaboration graph
[legend]

List of all members.

Public Member Functions

 SearchNormal (Manager &manager, const InputType &source, const TranslationOptionCollection &transOptColl)
 ~SearchNormal ()
void Decode ()
void OutputHypoStackSize ()
void OutputHypoStack ()
virtual const std::vector
< HypothesisStack * > & 
GetHypothesisStacks () const
virtual const HypothesisGetBestHypothesis () const

Protected Member Functions

virtual bool ProcessOneStack (HypothesisStack *hstack)
virtual void ProcessOneHypothesis (const Hypothesis &hypothesis)
virtual void ExpandAllHypotheses (const Hypothesis &hypothesis, size_t startPos, size_t endPos)
virtual void ExpandHypothesis (const Hypothesis &hypothesis, const TranslationOption &transOpt, float expectedScore)

Protected Attributes

const InputTypem_source
std::vector< HypothesisStack * > m_hypoStackColl
 stacks to store hypotheses (partial translations)
HypothesisStackNormalactual_hypoStack
const TranslationOptionCollectionm_transOptColl


Detailed Description

Functions and variables you need to decoder an input using the phrase-based decoder (NO cube-pruning) Instantiated by the Manager class

Definition at line 21 of file SearchNormal.h.


Constructor & Destructor Documentation

Moses::SearchNormal::SearchNormal ( Manager manager,
const InputType source,
const TranslationOptionCollection transOptColl 
)

Organizing main function

/param source input sentence /param transOptColl collection of translation options to be used for this sentence

Definition at line 19 of file SearchNormal.cpp.

References Moses::SearchOptions::beam_width, m_hypoStackColl, Moses::Search::m_manager, Moses::Search::m_options, m_source, Moses::AllOptions::search, Moses::HypothesisStackNormal::SetBeamWidth(), Moses::HypothesisStackNormal::SetMaxHypoStackSize(), Moses::SearchOptions::stack_size, and VERBOSE.

Here is the call graph for this function:

Moses::SearchNormal::~SearchNormal (  ) 

Definition at line 48 of file SearchNormal.cpp.

References m_hypoStackColl, and Moses::RemoveAllInColl().

Here is the call graph for this function:


Member Function Documentation

void Moses::SearchNormal::Decode (  )  [virtual]

Main decoder loop that translates a sentence by expanding hypotheses stack by stack, until the end of the sentence.

Implements Moses::Search.

Definition at line 84 of file SearchNormal.cpp.

References actual_hypoStack, Moses::Hypothesis::Create(), IFVERBOSE, m_hypoStackColl, Moses::Search::m_initialTransOpt, Moses::Search::m_manager, m_source, OutputHypoStackSize(), and ProcessOneStack().

Here is the call graph for this function:

void Moses::SearchNormal::ExpandAllHypotheses ( const Hypothesis hypothesis,
size_t  startPos,
size_t  endPos 
) [protected, virtual]

Expand a hypothesis given a list of translation options

Parameters:
hypothesis hypothesis to be expanded upon
startPos first word position of span covered
endPos last word position of span covered

Definition at line 246 of file SearchNormal.cpp.

References Moses::TranslationOptionList::begin(), Moses::SquareMatrix::CalcFutureScore(), Moses::TranslationOptionList::end(), ExpandHypothesis(), Moses::TranslationOptionCollection::GetFutureScore(), Moses::Hypothesis::GetScore(), Moses::TranslationOptionCollection::GetTranslationOptionList(), Moses::Hypothesis::GetWordsBitmap(), Moses::Search::m_options, m_transOptColl, Moses::AllOptions::search, and Moses::SearchOptions::UseEarlyDiscarding().

Referenced by ProcessOneHypothesis().

Here is the call graph for this function:

Here is the caller graph for this function:

void Moses::SearchNormal::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

Parameters:
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)

Definition at line 280 of file SearchNormal.cpp.

References Moses::SentenceStats::AddEarlyDiscarded(), Moses::SentenceStats::AddNotBuilt(), Moses::Hypothesis::CreateNext(), Moses::Hypothesis::EvaluateWhenApplied(), FREEHYPO, Moses::StaticData::GetEarlyDiscardingThreshold(), Moses::TranslationOption::GetEndPos(), Moses::TranslationOption::GetFutureScore(), Moses::TranslationOptionCollection::GetFutureScore(), Moses::WordsBitmap::GetIDPlus(), Moses::WordsBitmap::GetNumWordsCovered(), Moses::Manager::GetSentenceStats(), Moses::TranslationOption::GetSize(), Moses::TranslationOption::GetStartPos(), Moses::Hypothesis::GetWordsBitmap(), IFVERBOSE, Moses::StaticData::Instance(), m_hypoStackColl, Moses::Search::m_manager, Moses::Search::m_options, m_transOptColl, NULL, Moses::Hypothesis::PrintHypothesis(), Moses::AllOptions::search, Moses::SearchOptions::stack_diversity, Moses::SentenceStats::StartTimeBuildHyp(), Moses::SentenceStats::StartTimeStack(), Moses::stats, Moses::SentenceStats::StopTimeBuildHyp(), Moses::SentenceStats::StopTimeStack(), and Moses::SearchOptions::UseEarlyDiscarding().

Referenced by ExpandAllHypotheses().

Here is the call graph for this function:

Here is the caller graph for this function:

const Hypothesis * Moses::SearchNormal::GetBestHypothesis (  )  const [virtual]

Find best hypothesis on the last stack. This is the end point of the best translation, which can be traced back from here

Implements Moses::Search.

Definition at line 367 of file SearchNormal.cpp.

References actual_hypoStack, Moses::HypothesisStackNormal::GetBestHypothesis(), Moses::Search::interrupted_flag, and m_hypoStackColl.

Here is the call graph for this function:

const std::vector< HypothesisStack * > & Moses::SearchNormal::GetHypothesisStacks (  )  const [virtual]

Implements Moses::Search.

Definition at line 358 of file SearchNormal.cpp.

References m_hypoStackColl.

void Moses::SearchNormal::OutputHypoStack (  ) 

Definition at line 391 of file SearchNormal.cpp.

References m_hypoStackColl, and TRACE_ERR.

void Moses::SearchNormal::OutputHypoStackSize (  ) 

Logging of hypothesis stack sizes

Definition at line 381 of file SearchNormal.cpp.

References m_hypoStackColl, and TRACE_ERR.

Referenced by Decode().

Here is the caller graph for this function:

void Moses::SearchNormal::ProcessOneHypothesis ( const Hypothesis hypothesis  )  [protected, virtual]

bool Moses::SearchNormal::ProcessOneStack ( HypothesisStack hstack  )  [protected, virtual]


Member Data Documentation

actual (full expanded) stack of hypotheses

Definition at line 30 of file SearchNormal.h.

Referenced by Decode(), and GetBestHypothesis().

stacks to store hypotheses (partial translations)

Definition at line 27 of file SearchNormal.h.

Referenced by Decode(), ExpandHypothesis(), GetBestHypothesis(), GetHypothesisStacks(), OutputHypoStack(), OutputHypoStackSize(), SearchNormal(), and ~SearchNormal().

Definition at line 24 of file SearchNormal.h.

Referenced by Decode(), ProcessOneHypothesis(), and SearchNormal().

pre-computed list of translation options for the phrases in this sentence

Definition at line 33 of file SearchNormal.h.

Referenced by ExpandAllHypotheses(), ExpandHypothesis(), and ProcessOneHypothesis().


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

Generated on Tue Sep 1 00:33:41 2015 for Moses by  doxygen 1.5.9