#include <Manager.h>

Public Member Functions | |
| Manager (InputType const &source, SearchAlgorithm searchAlgorithm, const TranslationSystem *system) | |
| ~Manager () | |
| const TranslationOptionCollection * | getSntTranslationOptions () |
| const TranslationSystem * | GetTranslationSystem () |
| void | ProcessSentence () |
| const Hypothesis * | GetBestHypothesis () const |
| const Hypothesis * | GetActualBestHypothesis () const |
| void | CalcNBest (size_t count, TrellisPathList &ret, bool onlyDistinct=0) const |
| void | CalcLatticeSamples (size_t count, TrellisPathList &ret) const |
| void | PrintAllDerivations (long translationId, std::ostream &outputStream) const |
| void | printDivergentHypothesis (long translationId, const Hypothesis *hypo, const std::vector< const TargetPhrase * > &remainingPhrases, float remainingScore, std::ostream &outputStream) const |
| void | printThisHypothesis (long translationId, const Hypothesis *hypo, const std::vector< const TargetPhrase * > &remainingPhrases, float remainingScore, std::ostream &outputStream) const |
| void | GetWordGraph (long translationId, std::ostream &outputWordGraphStream) const |
| int | GetNextHypoId () |
| void | OutputSearchGraph (long translationId, std::ostream &outputSearchGraphStream) const |
| void | GetSearchGraph (std::vector< SearchGraphNode > &searchGraph) const |
| const InputType & | GetSource () const |
| void | CalcDecoderStatistics () const |
| void | ResetSentenceStats (const InputType &source) |
| SentenceStats & | GetSentenceStats () const |
| void | GetForwardBackwardSearchGraph (std::map< int, bool > *pConnected, std::vector< const Hypothesis * > *pConnectedList, std::map< const Hypothesis *, std::set< const Hypothesis * > > *pOutgoingHyps, std::vector< float > *pFwdBwdScores) const |
Public Attributes | |
| InputType const & | m_source |
Protected Member Functions | |
| void | GetConnectedGraph (std::map< int, bool > *pConnected, std::vector< const Hypothesis * > *pConnectedList) const |
| void | GetWinnerConnectedGraph (std::map< int, bool > *pConnected, std::vector< const Hypothesis * > *pConnectedList) const |
Protected Attributes | |
| TranslationOptionCollection * | m_transOptColl |
| Search * | m_search |
| HypothesisStack * | actual_hypoStack |
| clock_t | m_start |
| size_t | interrupted_flag |
| std::auto_ptr< SentenceStats > | m_sentenceStats |
| int | m_hypoId |
The main decoder loop in the function ProcessSentence() consists of the steps:
Definition at line 91 of file Manager.h.
| Moses::Manager::Manager | ( | InputType const & | source, | |
| SearchAlgorithm | searchAlgorithm, | |||
| const TranslationSystem * | system | |||
| ) |
Definition at line 51 of file Manager.cpp.
References Moses::TranslationSystem::InitializeBeforeSentenceProcessing().

| Moses::Manager::~Manager | ( | ) |
Definition at line 63 of file Manager.cpp.
References Moses::TranslationSystem::CleanUpAfterSentenceProcessing(), end, m_search, m_start, m_transOptColl, and VERBOSE.

| void Moses::Manager::CalcDecoderStatistics | ( | ) | const |
Definition at line 407 of file Manager.cpp.
References Moses::SentenceStats::CalcFinalStats(), GetBestHypothesis(), Moses::Hypothesis::GetCurrSourceWordsRange(), Moses::Hypothesis::GetCurrTargetPhrase(), Moses::Hypothesis::GetInput(), Moses::Hypothesis::GetPrevHypo(), GetSentenceStats(), IFVERBOSE, NULL, and TRACE_ERR.

| void Moses::Manager::CalcLatticeSamples | ( | size_t | count, | |
| TrellisPathList & | ret | |||
| ) | const |
Implements lattice sampling, as in Chatterjee & Cancedda, emnlp 2010
Definition at line 267 of file Manager.cpp.
References Moses::TrellisPathList::Add(), CHECK, Moses::Hypothesis::GetId(), Moses::Hypothesis::GetPrevHypo(), Moses::Hypothesis::GetScore(), GetSearchGraph(), and Moses::log_sum().

| void Moses::Manager::CalcNBest | ( | size_t | count, | |
| TrellisPathList & | ret, | |||
| bool | onlyDistinct = 0 | |||
| ) | const |
After decoding, the hypotheses in the stacks and additional arcs form a search graph that can be mined for n-best lists. The heavy lifting is done in the TrellisPath and TrellisPathCollection this function controls this for one sentence.
| count | the number of n-best translations to produce | |
| ret | holds the n-best list that was calculated |
Definition at line 200 of file Manager.cpp.
References Moses::TrellisPathList::Add(), Moses::TrellisPathCollection::Add(), CHECK, Moses::TrellisPath::CreateDeviantPaths(), Moses::Search::GetHypothesisStacks(), Moses::StaticData::GetNBestFactor(), Moses::TrellisPathCollection::GetSize(), Moses::TrellisPathList::GetSize(), Moses::TrellisPath::GetSurfacePhrase(), Moses::StaticData::Instance(), m_search, NULL, Moses::TrellisPathCollection::pop(), and Moses::TrellisPathCollection::Prune().

| const Hypothesis* Moses::Manager::GetActualBestHypothesis | ( | ) | const |
| const Hypothesis * Moses::Manager::GetBestHypothesis | ( | ) | const |
Definition at line 977 of file Manager.cpp.
References Moses::Search::GetBestHypothesis(), and m_search.
Referenced by CalcDecoderStatistics(), doConsensusDecoding(), and getLatticeMBRNBest().


| void Moses::Manager::GetConnectedGraph | ( | std::map< int, bool > * | pConnected, | |
| std::vector< const Hypothesis * > * | pConnectedList | |||
| ) | const [protected] |
Definition at line 701 of file Manager.cpp.
References Moses::HypothesisStack::begin(), Moses::HypothesisStack::end(), Moses::Hypothesis::GetArcList(), Moses::Search::GetHypothesisStacks(), Moses::Hypothesis::GetId(), Moses::Hypothesis::GetPrevHypo(), m_search, and NULL.

| void Moses::Manager::GetForwardBackwardSearchGraph | ( | std::map< int, bool > * | pConnected, | |
| std::vector< const Hypothesis * > * | pConnectedList, | |||
| std::map< const Hypothesis *, std::set< const Hypothesis * > > * | pOutgoingHyps, | |||
| std::vector< float > * | pFwdBwdScores | |||
| ) | const |
Referenced by doConsensusDecoding(), and getLatticeMBRNBest().

| int Moses::Manager::GetNextHypoId | ( | ) |
| void Moses::Manager::GetSearchGraph | ( | std::vector< SearchGraphNode > & | searchGraph | ) | const |
Referenced by CalcLatticeSamples(), and OutputSearchGraph().

| SentenceStats & Moses::Manager::GetSentenceStats | ( | ) | const |
Definition at line 991 of file Manager.cpp.
References m_sentenceStats.
Referenced by Moses::HypothesisStackNormal::AddPrune(), Moses::HypothesisStackCubePruning::AddPrune(), CalcDecoderStatistics(), Moses::Hypothesis::CalcExpectedScore(), Moses::Hypothesis::CalcRemainingScore(), Moses::Hypothesis::CalcScore(), Moses::LanguageModelImplementation::Evaluate(), Moses::SearchNormal::ExpandHypothesis(), Moses::Hypothesis::Hypothesis(), Moses::SearchNormal::ProcessSentence(), Moses::SearchCubePruning::ProcessSentence(), ProcessSentence(), Moses::HypothesisStackNormal::PruneToSize(), and Moses::HypothesisStackCubePruning::PruneToSize().

| const TranslationOptionCollection * Moses::Manager::getSntTranslationOptions | ( | ) |
| const InputType& Moses::Manager::GetSource | ( | ) | const [inline] |
Definition at line 142 of file Manager.h.
References m_source.
Referenced by Moses::HypothesisStackCubePruning::SetBitmapAccessor().

| const TranslationSystem* Moses::Manager::GetTranslationSystem | ( | ) | [inline] |
Definition at line 122 of file Manager.h.
Referenced by Moses::Hypothesis::CalcRemainingScore(), Moses::Hypothesis::CalcScore(), Moses::Hypothesis::Hypothesis(), and Moses::HypothesisStackCubePruning::SetBitmapAccessor().

| void Moses::Manager::GetWinnerConnectedGraph | ( | std::map< int, bool > * | pConnected, | |
| std::vector< const Hypothesis * > * | pConnectedList | |||
| ) | const [protected] |
Definition at line 744 of file Manager.cpp.
References Moses::HypothesisStack::begin(), Moses::HypothesisStack::end(), Moses::Hypothesis::GetArcList(), Moses::Search::GetHypothesisStacks(), Moses::Hypothesis::GetId(), Moses::Hypothesis::GetPrevHypo(), m_search, and NULL.

| void Moses::Manager::GetWordGraph | ( | long | translationId, | |
| std::ostream & | outputWordGraphStream | |||
| ) | const |
Definition at line 510 of file Manager.cpp.
References Moses::HypothesisStack::begin(), Moses::HypothesisStack::end(), Moses::Hypothesis::GetArcList(), Moses::Search::GetHypothesisStacks(), Moses::StaticData::GetParam(), Moses::StaticData::Instance(), m_search, NULL, Moses::OutputWordGraph(), and Moses::Scan< bool >().

| void Moses::Manager::OutputSearchGraph | ( | long | translationId, | |
| std::ostream & | outputSearchGraphStream | |||
| ) | const |
Definition at line 890 of file Manager.cpp.
References GetSearchGraph(), and Moses::OutputSearchNode().

| void Moses::Manager::PrintAllDerivations | ( | long | translationId, | |
| std::ostream & | outputStream | |||
| ) | const |
| void Moses::Manager::printDivergentHypothesis | ( | long | translationId, | |
| const Hypothesis * | hypo, | |||
| const std::vector< const TargetPhrase * > & | remainingPhrases, | |||
| float | remainingScore, | |||
| std::ostream & | outputStream | |||
| ) | const |
| void Moses::Manager::printThisHypothesis | ( | long | translationId, | |
| const Hypothesis * | hypo, | |||
| const std::vector< const TargetPhrase * > & | remainingPhrases, | |||
| float | remainingScore, | |||
| std::ostream & | outputStream | |||
| ) | const |
| void Moses::Manager::ProcessSentence | ( | ) |
Main decoder loop that translates a sentence by expanding hypotheses stack by stack, until the end of the sentence.
Definition at line 81 of file Manager.cpp.
References Moses::SentenceStats::AddTimeCollectOpts(), Moses::TranslationOptionCollection::CreateTranslationOptions(), GetSentenceStats(), IFVERBOSE, Moses::TranslationSystem::InitializeBeforeSentenceProcessing(), m_search, m_source, m_start, m_transOptColl, Moses::Search::ProcessSentence(), ResetSentenceStats(), and VERBOSE.

| void Moses::Manager::ResetSentenceStats | ( | const InputType & | source | ) |
Definition at line 987 of file Manager.cpp.
References m_sentenceStats.
Referenced by ProcessSentence().

HypothesisStack* Moses::Manager::actual_hypoStack [protected] |
size_t Moses::Manager::interrupted_flag [protected] |
int Moses::Manager::m_hypoId [protected] |
Search* Moses::Manager::m_search [protected] |
Definition at line 101 of file Manager.h.
Referenced by CalcNBest(), GetBestHypothesis(), GetConnectedGraph(), GetWinnerConnectedGraph(), GetWordGraph(), ProcessSentence(), and ~Manager().
std::auto_ptr<SentenceStats> Moses::Manager::m_sentenceStats [protected] |
Definition at line 106 of file Manager.h.
Referenced by GetSentenceStats(), and ResetSentenceStats().
source sentence to be translated
Definition at line 118 of file Manager.h.
Referenced by GetSource(), and ProcessSentence().
clock_t Moses::Manager::m_start [protected] |
actual (full expanded) stack of hypotheses starting time, used for logging
Definition at line 104 of file Manager.h.
Referenced by ProcessSentence(), and ~Manager().
pre-computed list of translation options for the phrases in this sentence
Definition at line 100 of file Manager.h.
Referenced by getSntTranslationOptions(), ProcessSentence(), and ~Manager().
1.5.9