Moses::SearchNormal Class Reference

#include <SearchNormal.h>

Inheritance diagram for Moses::SearchNormal:

Inheritance graph
Collaboration diagram for Moses::SearchNormal:

Collaboration graph

List of all members.

Public Member Functions

 SearchNormal (Manager &manager, 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, float estimatedScore, const Bitmap &bitmap)

Protected Attributes

std::vector< HypothesisStack * > m_hypoStackColl
 stacks to store hypotheses (partial translations)
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 20 of file SearchNormal.h.

Constructor & Destructor Documentation

Moses::SearchNormal::SearchNormal ( Manager manager,
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, Moses::Search::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 37 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 73 of file SearchNormal.cpp.

References actual_hypoStack, Moses::Bitmaps::GetInitialBitmap(), Moses::Manager::GetNextHypoId(), IFVERBOSE, Moses::Search::m_bitmaps, m_hypoStackColl, Moses::Search::m_initialTransOpt, Moses::Search::m_manager, Moses::Search::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]

void Moses::SearchNormal::ExpandHypothesis ( const Hypothesis hypothesis,
const TranslationOption transOpt,
float  expectedScore,
float  estimatedScore,
const Bitmap bitmap 
) [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)

Definition at line 277 of file SearchNormal.cpp.

References Moses::SentenceStats::AddEarlyDiscarded(), Moses::SentenceStats::AddNotBuilt(), Moses::SearchOptions::early_discarding_threshold, Moses::Hypothesis::EvaluateWhenApplied(), Moses::TranslationOption::GetEndPos(), Moses::TranslationOption::GetFutureScore(), Moses::Bitmap::GetIDPlus(), Moses::Manager::GetNextHypoId(), Moses::Bitmap::GetNumWordsCovered(), Moses::Manager::GetSentenceStats(), Moses::TranslationOption::GetSize(), Moses::TranslationOption::GetStartPos(), Moses::Hypothesis::GetWordsBitmap(), IFVERBOSE, m_hypoStackColl, Moses::Search::m_manager, Moses::Search::m_options, NULL, Moses::Hypothesis::PrintHypothesis(), Moses::AllOptions::search, Moses::SearchOptions::stack_diversity, Moses::SentenceStats::StartTimeBuildHyp(), Moses::SentenceStats::StartTimeEstimateScore(), Moses::SentenceStats::StartTimeOtherScore(), Moses::SentenceStats::StartTimeStack(), Moses::stats, Moses::SentenceStats::StopTimeBuildHyp(), Moses::SentenceStats::StopTimeEstimateScore(), Moses::SentenceStats::StopTimeOtherScore(), 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 384 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 375 of file SearchNormal.cpp.

References m_hypoStackColl.

void Moses::SearchNormal::OutputHypoStack (  ) 

Definition at line 408 of file SearchNormal.cpp.

References m_hypoStackColl, and TRACE_ERR.

void Moses::SearchNormal::OutputHypoStackSize (  ) 

Logging of hypothesis stack sizes

Definition at line 398 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 28 of file SearchNormal.h.

Referenced by Decode(), and GetBestHypothesis().

stacks to store hypotheses (partial translations)

Definition at line 25 of file SearchNormal.h.

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

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

Definition at line 31 of file SearchNormal.h.

Referenced by ExpandAllHypotheses(), and ProcessOneHypothesis().

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

Generated on Mon Feb 8 00:32:54 2016 for Moses by  doxygen 1.5.9