#include "LatticeMBR.h"#include "StaticData.h"#include <algorithm>#include <set>Go to the source code of this file.
Functions | |
| void | GetOutputWords (const TrellisPath &path, vector< Word > &translation) |
| void | extract_ngrams (const vector< Word > &sentence, map< Phrase, int > &allngrams) |
| void | pruneLatticeFB (Lattice &connectedHyp, map< const Hypothesis *, set< const Hypothesis * > > &outgoingHyps, map< const Hypothesis *, vector< Edge > > &incomingEdges, const vector< float > &estimatedScores, const Hypothesis *bestHypo, size_t edgeDensity, float scale) |
| void | calcNgramExpectations (Lattice &connectedHyp, map< const Hypothesis *, vector< Edge > > &incomingEdges, map< Phrase, float > &finalNgramScores, bool posteriors) |
| ostream & | operator<< (ostream &out, const Edge &edge) |
| bool | ascendingCoverageCmp (const Hypothesis *a, const Hypothesis *b) |
| void | getLatticeMBRNBest (Manager &manager, TrellisPathList &nBestList, vector< LatticeMBRSolution > &solutions, size_t n) |
| vector< Word > | doLatticeMBR (Manager &manager, TrellisPathList &nBestList) |
| const TrellisPath | doConsensusDecoding (Manager &manager, TrellisPathList &nBestList) |
Variables | |
| size_t | bleu_order = 4 |
| float | UNKNGRAMLOGPROB = -20 |
| bool ascendingCoverageCmp | ( | const Hypothesis * | a, | |
| const Hypothesis * | b | |||
| ) |
Definition at line 494 of file LatticeMBR.cpp.
References Moses::WordsBitmap::GetNumWordsCovered(), and Moses::Hypothesis::GetWordsBitmap().
Referenced by calcNgramExpectations().


| void calcNgramExpectations | ( | Lattice & | connectedHyp, | |
| map< const Hypothesis *, vector< Edge > > & | incomingEdges, | |||
| map< Phrase, float > & | finalNgramScores, | |||
| bool | posteriors | |||
| ) |
Definition at line 275 of file LatticeMBR.cpp.
References NgramScores::addScore(), Moses::Phrase::AddWord(), Moses::ARRAY_SIZE_INCR, ascendingCoverageCmp(), bleu_order, end, Moses::Hypothesis::GetId(), Edge::GetNgrams(), Moses::WordsBitmap::GetNumWordsCovered(), Edge::GetPhraseSuffix(), Edge::GetScore(), Moses::Phrase::GetSize(), Edge::GetTailNode(), Moses::Phrase::GetWord(), Edge::GetWords(), Moses::Hypothesis::GetWordsBitmap(), Edge::GetWordsSize(), IFVERBOSE, index, Moses::WordsBitmap::IsComplete(), Moses::log_sum(), NgramScores::nodeBegin(), NgramScores::nodeEnd(), Edge::storeNgramHistory(), and VERBOSE.
Referenced by doConsensusDecoding(), and getLatticeMBRNBest().


| const TrellisPath doConsensusDecoding | ( | Manager & | manager, | |
| TrellisPathList & | nBestList | |||
| ) |
Definition at line 554 of file LatticeMBR.cpp.
References Moses::TrellisPathList::begin(), BLEU_ORDER, calcNgramExpectations(), Moses::TrellisPathList::end(), extract_ngrams(), Moses::Manager::GetBestHypothesis(), Moses::Manager::GetForwardBackwardSearchGraph(), Moses::StaticData::GetLatticeMBRPruningFactor(), Moses::StaticData::GetMBRScale(), GetOutputWords(), pruneLatticeFB(), SMOOTH, and VERBOSE.
Referenced by TranslationTask::Run().


| vector<Word> doLatticeMBR | ( | Manager & | manager, | |
| TrellisPathList & | nBestList | |||
| ) |
Definition at line 546 of file LatticeMBR.cpp.
References getLatticeMBRNBest().
Referenced by main(), and TranslationTask::Run().


Definition at line 35 of file LatticeMBR.cpp.
References Moses::Phrase::AddWord(), and bleu_order.
Referenced by doConsensusDecoding(), and doMBR().


| void getLatticeMBRNBest | ( | Manager & | manager, | |
| TrellisPathList & | nBestList, | |||
| vector< LatticeMBRSolution > & | solutions, | |||
| size_t | n | |||
| ) |
Definition at line 499 of file LatticeMBR.cpp.
References Moses::TrellisPathList::begin(), bleu_order, calcNgramExpectations(), Moses::TrellisPathList::end(), Moses::Manager::GetBestHypothesis(), Moses::Manager::GetForwardBackwardSearchGraph(), Moses::StaticData::GetLatticeMBRMapWeight(), Moses::StaticData::GetLatticeMBRPRatio(), Moses::StaticData::GetLatticeMBRPrecision(), Moses::StaticData::GetLatticeMBRPruningFactor(), Moses::StaticData::GetLatticeMBRThetas(), Moses::StaticData::GetMBRScale(), IFVERBOSE, pruneLatticeFB(), and VERBOSE.
Referenced by doLatticeMBR(), and TranslationTask::Run().


| void GetOutputWords | ( | const TrellisPath & | path, | |
| vector< Word > & | translation | |||
| ) |
Definition at line 19 of file LatticeMBR.cpp.
References Moses::Hypothesis::GetCurrTargetPhrase(), Moses::TrellisPath::GetEdges(), Moses::Phrase::GetSize(), and Moses::Phrase::GetWord().
Referenced by doConsensusDecoding().


| ostream& operator<< | ( | ostream & | out, | |
| const Edge & | edge | |||
| ) |
Definition at line 488 of file LatticeMBR.cpp.
References Moses::Hypothesis::GetId().

| void pruneLatticeFB | ( | Lattice & | connectedHyp, | |
| map< const Hypothesis *, set< const Hypothesis * > > & | outgoingHyps, | |||
| map< const Hypothesis *, vector< Edge > > & | incomingEdges, | |||
| const vector< float > & | estimatedScores, | |||
| const Hypothesis * | bestHypo, | |||
| size_t | edgeDensity, | |||
| float | scale | |||
| ) |
Definition at line 130 of file LatticeMBR.cpp.
References Moses::Hypothesis::GetArcList(), Moses::Hypothesis::GetCurrTargetPhrase(), Moses::Hypothesis::GetId(), Moses::Hypothesis::GetPrevHypo(), Moses::Hypothesis::GetScore(), Moses::Hypothesis::GetSize(), IFVERBOSE, NULL, and VERBOSE.
Referenced by doConsensusDecoding(), and getLatticeMBRNBest().


| size_t bleu_order = 4 |
Definition at line 17 of file LatticeMBR.cpp.
Referenced by calcNgramExpectations(), extract_ngrams(), and getLatticeMBRNBest().
| float UNKNGRAMLOGPROB = -20 |
Definition at line 18 of file LatticeMBR.cpp.
1.5.9