#include <SearchCubePruning.h>
Public Member Functions | |
SearchCubePruning (Manager &manager, const TranslationOptionCollection &transOptColl) | |
~SearchCubePruning () | |
void | Decode () |
void | OutputHypoStackSize () |
void | OutputHypoStack (int stack) |
virtual const std::vector < HypothesisStack * > & | GetHypothesisStacks () const |
virtual const Hypothesis * | GetBestHypothesis () const |
Protected Member Functions | |
void | CreateForwardTodos (HypothesisStackCubePruning &stack) |
go thru all bitmaps in 1 stack & create backpointers to bitmaps in the stack | |
void | CreateForwardTodos (const Bitmap &bitmap, const Range &range, BitmapContainer &bitmapContainer) |
create a back pointer to this bitmap, with edge that has this words range translation | |
bool | CheckDistortion (const Bitmap &bitmap, const Range &range) const |
void | PrintBitmapContainerGraph () |
Protected Attributes | |
std::vector< HypothesisStack * > | m_hypoStackColl |
const TranslationOptionCollection & | m_transOptColl |
Definition at line 18 of file SearchCubePruning.h.
Moses::SearchCubePruning::SearchCubePruning | ( | Manager & | manager, | |
const TranslationOptionCollection & | transOptColl | |||
) |
Definition at line 53 of file SearchCubePruning.cpp.
References Moses::SearchOptions::beam_width, m_hypoStackColl, Moses::Search::m_manager, Moses::Search::m_options, Moses::AllOptions::search, Moses::HypothesisStackCubePruning::SetBeamWidth(), Moses::HypothesisStackCubePruning::SetMaxHypoStackSize(), and Moses::SearchOptions::stack_size.
Moses::SearchCubePruning::~SearchCubePruning | ( | ) |
Definition at line 68 of file SearchCubePruning.cpp.
References m_hypoStackColl, and Moses::RemoveAllInColl().
bool Moses::SearchCubePruning::CheckDistortion | ( | const Bitmap & | bitmap, | |
const Range & | range | |||
) | const [protected] |
Definition at line 266 of file SearchCubePruning.cpp.
References Moses::ReorderingConstraint::Check(), Moses::InputType::ComputeDistortionDistance(), Moses::Range::GetEndPos(), Moses::Bitmap::GetFirstGapPos(), Moses::InputType::GetReorderingConstraint(), Moses::Range::GetStartPos(), Moses::Search::m_manager, Moses::Search::m_source, and Moses::BaseManager::options().
Referenced by CreateForwardTodos().
void Moses::SearchCubePruning::CreateForwardTodos | ( | const Bitmap & | bitmap, | |
const Range & | range, | |||
BitmapContainer & | bitmapContainer | |||
) | [protected] |
create a back pointer to this bitmap, with edge that has this words range translation
Definition at line 246 of file SearchCubePruning.cpp.
References Moses::Bitmaps::GetBitmap(), Moses::TranslationOptionCollection::GetEstimatedScores(), Moses::Bitmap::GetNumWordsCovered(), Moses::TranslationOptionCollection::GetTranslationOptionList(), Moses::Search::m_bitmaps, m_hypoStackColl, m_transOptColl, Moses::HypothesisStackCubePruning::SetBitmapAccessor(), and Moses::TranslationOptionList::size().
void Moses::SearchCubePruning::CreateForwardTodos | ( | HypothesisStackCubePruning & | stack | ) | [protected] |
go thru all bitmaps in 1 stack & create backpointers to bitmaps in the stack
Definition at line 194 of file SearchCubePruning.cpp.
References Moses::HypothesisStackCubePruning::AddHypothesesToBitmapContainers(), CheckDistortion(), Moses::HypothesisStackCubePruning::GetBitmapAccessor(), Moses::BitmapContainer::GetHypothesesSize(), Moses::InputType::GetSize(), Moses::Bitmap::GetValue(), Moses::Search::m_manager, Moses::Search::m_source, Moses::BaseManager::options(), and Moses::BitmapContainer::SortHypotheses().
Referenced by Decode().
void Moses::SearchCubePruning::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 77 of file SearchCubePruning.cpp.
References Moses::SentenceStats::AddPopped(), Moses::HypothesisStackCubePruning::CleanupArcList(), CreateForwardTodos(), Moses::BitmapContainer::Empty(), Moses::HypothesisStackCubePruning::GetBitmapAccessor(), Moses::Bitmaps::GetInitialBitmap(), Moses::Manager::GetNextHypoId(), Moses::Manager::GetSentenceStats(), IFVERBOSE, Moses::Search::m_bitmaps, m_hypoStackColl, Moses::Search::m_initialTransOpt, Moses::Search::m_manager, Moses::Search::m_options, Moses::Search::m_source, Moses::BaseManager::options(), Moses::Search::out_of_time(), Moses::BitmapContainer::ProcessBestHypothesis(), Moses::HypothesisStackCubePruning::PruneToSize(), Moses::AllOptions::search, Moses::SearchOptions::stack_size, Moses::SentenceStats::StartTimeManageCubes(), Moses::SentenceStats::StartTimeOtherScore(), Moses::SentenceStats::StartTimeSetupCubes(), Moses::SentenceStats::StartTimeStack(), Moses::SentenceStats::StopTimeManageCubes(), Moses::SentenceStats::StopTimeOtherScore(), Moses::SentenceStats::StopTimeSetupCubes(), Moses::SentenceStats::StopTimeStack(), and VERBOSE.
Hypothesis const * Moses::SearchCubePruning::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 305 of file SearchCubePruning.cpp.
References Moses::HypothesisStack::GetBestHypothesis(), and m_hypoStackColl.
const std::vector< HypothesisStack * > & Moses::SearchCubePruning::GetHypothesisStacks | ( | ) | const [virtual] |
Implements Moses::Search.
Definition at line 359 of file SearchCubePruning.cpp.
References m_hypoStackColl.
void Moses::SearchCubePruning::OutputHypoStack | ( | int | stack | ) |
Logging of hypothesis stack contents
stack | number of stack to be reported, report all stacks if 0 |
Definition at line 344 of file SearchCubePruning.cpp.
References m_hypoStackColl, and TRACE_ERR.
void Moses::SearchCubePruning::OutputHypoStackSize | ( | ) |
Logging of hypothesis stack sizes
Definition at line 317 of file SearchCubePruning.cpp.
References m_hypoStackColl, and TRACE_ERR.
void Moses::SearchCubePruning::PrintBitmapContainerGraph | ( | ) | [protected] |
Definition at line 327 of file SearchCubePruning.cpp.
References Moses::HypothesisStackCubePruning::GetBitmapAccessor(), and m_hypoStackColl.
std::vector< HypothesisStack* > Moses::SearchCubePruning::m_hypoStackColl [protected] |
stacks to store hypotheses (partial translations)
Definition at line 21 of file SearchCubePruning.h.
Referenced by CreateForwardTodos(), Decode(), GetBestHypothesis(), GetHypothesisStacks(), OutputHypoStack(), OutputHypoStackSize(), PrintBitmapContainerGraph(), SearchCubePruning(), and ~SearchCubePruning().
const TranslationOptionCollection& Moses::SearchCubePruning::m_transOptColl [protected] |
pre-computed list of translation options for the phrases in this sentence
Definition at line 23 of file SearchCubePruning.h.
Referenced by CreateForwardTodos().