MosesCmd Namespace Reference


Classes

class  IOWrapper
class  Edge
class  NgramScores
class  LatticeMBRSolution
struct  LatticeMBRSolutionComparator
class  Grid
class  TranslationTask

Typedefs

typedef std::vector< const
Moses::Hypothesis * > 
Lattice
typedef std::vector< const Edge * > Path
typedef std::map< Path, size_t > PathCounts
typedef std::map
< Moses::Phrase, PathCounts
NgramHistory

Functions

void OutputSurface (std::ostream &out, const Hypothesis &edge, const std::vector< FactorType > &outputFactorOrder, bool reportSegmentation, bool reportAllFactors)
void OutputBestSurface (std::ostream &out, const Hypothesis *hypo, const std::vector< FactorType > &outputFactorOrder, bool reportSegmentation, bool reportAllFactors)
void OutputAlignment (ostream &out, const AlignmentInfo &ai, size_t sourceOffset, size_t targetOffset)
void OutputAlignment (ostream &out, const vector< const Hypothesis * > &edges)
void OutputAlignment (std::ostream &out, const Moses::Hypothesis *hypo)
void OutputAlignment (OutputCollector *collector, size_t lineNo, const vector< const Hypothesis * > &edges)
void OutputAlignment (OutputCollector *collector, size_t lineNo, const Hypothesis *hypo)
void OutputAlignment (OutputCollector *collector, size_t lineNo, const TrellisPath &path)
void OutputBestHypo (const Moses::TrellisPath &path, long, bool reportSegmentation, bool reportAllFactors, std::ostream &out)
void OutputBestHypo (const std::vector< Word > &mbrBestHypo, long, bool, bool, ostream &out)
void OutputInput (std::vector< const Phrase * > &map, const Hypothesis *hypo)
void OutputInput (std::ostream &os, const Hypothesis *hypo)
void OutputNBest (std::ostream &out, const Moses::TrellisPathList &nBestList, const std::vector< Moses::FactorType > &outputFactorOrder, long translationId, bool reportSegmentation)
void OutputAllFeatureScores (const Moses::ScoreComponentCollection &features, std::ostream &out)
void OutputFeatureScores (std::ostream &out, const ScoreComponentCollection &features, const FeatureFunction *ff, std::string &lastName)
void OutputLatticeMBRNBest (std::ostream &out, const vector< LatticeMBRSolution > &solutions, long translationId)
bool ReadInput (IOWrapper &ioWrapper, InputTypeEnum inputType, InputType *&source)
IOWrapperGetIOWrapper (const StaticData &staticData)
void OutputBestSurface (std::ostream &out, const Moses::Hypothesis *hypo, const std::vector< Moses::FactorType > &outputFactorOrder, bool reportSegmentation, bool reportAllFactors)
void OutputLatticeMBRNBest (std::ostream &out, const std::vector< LatticeMBRSolution > &solutions, long translationId)
void OutputBestHypo (const std::vector< Moses::Word > &mbrBestHypo, long, bool reportSegmentation, bool reportAllFactors, std::ostream &out)
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< WorddoLatticeMBR (Manager &manager, TrellisPathList &nBestList)
const TrellisPath doConsensusDecoding (Manager &manager, TrellisPathList &nBestList)
void pruneLatticeFB (Lattice &connectedHyp, std::map< const Moses::Hypothesis *, std::set< const Moses::Hypothesis * > > &outgoingHyps, std::map< const Moses::Hypothesis *, std::vector< Edge > > &incomingEdges, const std::vector< float > &estimatedScores, const Moses::Hypothesis *, size_t edgeDensity, float scale)
void getLatticeMBRNBest (Moses::Manager &manager, Moses::TrellisPathList &nBestList, std::vector< LatticeMBRSolution > &solutions, size_t n)
void calcNgramExpectations (Lattice &connectedHyp, std::map< const Moses::Hypothesis *, std::vector< Edge > > &incomingEdges, std::map< Moses::Phrase, float > &finalNgramScores, bool posteriors)
void GetOutputFactors (const Moses::TrellisPath &path, std::vector< Moses::Word > &translation)
void extract_ngrams (const std::vector< Moses::Word > &sentence, std::map< Moses::Phrase, int > &allngrams)
void fix (std::ostream &stream, size_t size)
size_t OutputFeatureWeightsForHypergraph (size_t index, const FeatureFunction *ff, std::ostream &outputSearchGraphStream)
void OutputFeatureWeightsForHypergraph (std::ostream &outputSearchGraphStream)

Variables

size_t bleu_order = 4
float UNKNGRAMLOGPROB = -20

Typedef Documentation

typedef std::vector< const Moses::Hypothesis *> MosesCmd::Lattice

Definition at line 25 of file LatticeMBR.h.

Definition at line 30 of file LatticeMBR.h.

typedef std::vector<const Edge*> MosesCmd::Path

Definition at line 28 of file LatticeMBR.h.

typedef std::map<Path, size_t> MosesCmd::PathCounts

Definition at line 29 of file LatticeMBR.h.


Function Documentation

bool MosesCmd::ascendingCoverageCmp ( const Hypothesis a,
const Hypothesis b 
)

Definition at line 498 of file LatticeMBR.cpp.

References Moses::WordsBitmap::GetNumWordsCovered(), and Moses::Hypothesis::GetWordsBitmap().

Referenced by calcNgramExpectations().

Here is the call graph for this function:

Here is the caller graph for this function:

void MosesCmd::calcNgramExpectations ( Lattice &  connectedHyp,
std::map< const Moses::Hypothesis *, std::vector< Edge > > &  incomingEdges,
std::map< Moses::Phrase, float > &  finalNgramScores,
bool  posteriors 
)

void MosesCmd::calcNgramExpectations ( Lattice &  connectedHyp,
map< const Hypothesis *, vector< Edge > > &  incomingEdges,
map< Phrase, float > &  finalNgramScores,
bool  posteriors 
)

const Moses::TrellisPath MosesCmd::doConsensusDecoding ( Manager manager,
TrellisPathList nBestList 
)

std::vector< Moses::Word > MosesCmd::doLatticeMBR ( Manager manager,
TrellisPathList nBestList 
)

Definition at line 550 of file LatticeMBR.cpp.

References getLatticeMBRNBest().

Referenced by main(), and MosesCmd::TranslationTask::Run().

Here is the call graph for this function:

Here is the caller graph for this function:

void MosesCmd::extract_ngrams ( const std::vector< Moses::Word > &  sentence,
std::map< Moses::Phrase, int > &  allngrams 
)

void MosesCmd::extract_ngrams ( const vector< Word > &  sentence,
map< Phrase, int > &  allngrams 
)

Definition at line 39 of file LatticeMBR.cpp.

References Moses::Phrase::AddWord(), bleu_order, and k.

Referenced by doConsensusDecoding(), and doMBR().

Here is the call graph for this function:

Here is the caller graph for this function:

void MosesCmd::fix ( std::ostream &  stream,
size_t  size 
)

Enforce rounding

Definition at line 71 of file Main.cpp.

Referenced by main(), and MosesCmd::TranslationTask::Run().

Here is the caller graph for this function:

IOWrapper * MosesCmd::GetIOWrapper ( const StaticData staticData  ) 

Definition at line 553 of file IOWrapper.cpp.

Referenced by main().

Here is the caller graph for this function:

void MosesCmd::getLatticeMBRNBest ( Moses::Manager manager,
Moses::TrellisPathList nBestList,
std::vector< LatticeMBRSolution > &  solutions,
size_t  n 
)

void MosesCmd::getLatticeMBRNBest ( Manager manager,
TrellisPathList nBestList,
vector< LatticeMBRSolution > &  solutions,
size_t  n 
)

void MosesCmd::GetOutputFactors ( const Moses::TrellisPath path,
std::vector< Moses::Word > &  translation 
)

Referenced by doMBR().

Here is the caller graph for this function:

void MosesCmd::GetOutputWords ( const TrellisPath path,
vector< Word > &  translation 
)

Definition at line 23 of file LatticeMBR.cpp.

References Moses::Hypothesis::GetCurrTargetPhrase(), Moses::TrellisPath::GetEdges(), Moses::Phrase::GetSize(), and Moses::Phrase::GetWord().

Referenced by doConsensusDecoding().

Here is the call graph for this function:

Here is the caller graph for this function:

ostream& MosesCmd::operator<< ( ostream &  out,
const Edge &  edge 
)

Definition at line 492 of file LatticeMBR.cpp.

References Moses::Hypothesis::GetId().

Here is the call graph for this function:

void MosesCmd::OutputAlignment ( OutputCollector collector,
size_t  lineNo,
const TrellisPath path 
)

Definition at line 299 of file IOWrapper.cpp.

References Moses::TrellisPath::GetEdges(), and OutputAlignment().

Here is the call graph for this function:

void MosesCmd::OutputAlignment ( OutputCollector collector,
size_t  lineNo,
const Hypothesis hypo 
)

Definition at line 285 of file IOWrapper.cpp.

References Moses::Hypothesis::GetPrevHypo(), and OutputAlignment().

Here is the call graph for this function:

void MosesCmd::OutputAlignment ( OutputCollector collector,
size_t  lineNo,
const vector< const Hypothesis * > &  edges 
)

Definition at line 277 of file IOWrapper.cpp.

References OutputAlignment(), and Moses::OutputCollector::Write().

Here is the call graph for this function:

void MosesCmd::OutputAlignment ( std::ostream &  out,
const Moses::Hypothesis hypo 
)

Definition at line 264 of file IOWrapper.cpp.

References Moses::Hypothesis::GetPrevHypo(), and OutputAlignment().

Here is the call graph for this function:

void MosesCmd::OutputAlignment ( ostream &  out,
const vector< const Hypothesis * > &  edges 
)

void MosesCmd::OutputAlignment ( ostream &  out,
const AlignmentInfo ai,
size_t  sourceOffset,
size_t  targetOffset 
)

Definition at line 235 of file IOWrapper.cpp.

References Moses::AlignmentInfo::GetSortedAlignments().

Referenced by OutputAlignment(), OutputNBest(), and MosesCmd::TranslationTask::Run().

Here is the call graph for this function:

Here is the caller graph for this function:

void MosesCmd::OutputAllFeatureScores ( const Moses::ScoreComponentCollection features,
std::ostream &  out 
)

Definition at line 454 of file IOWrapper.cpp.

References Moses::FeatureFunction::GetScoreProducerDescription(), Moses::FeatureFunction::IsTuneable(), and OutputFeatureScores().

Referenced by OutputNBest().

Here is the call graph for this function:

Here is the caller graph for this function:

void MosesCmd::OutputBestHypo ( const std::vector< Moses::Word > &  mbrBestHypo,
long  ,
bool  reportSegmentation,
bool  reportAllFactors,
std::ostream &  out 
)

void MosesCmd::OutputBestHypo ( const std::vector< Word > &  mbrBestHypo,
long  ,
bool  ,
bool  ,
ostream &  out 
)

Definition at line 326 of file IOWrapper.cpp.

References CHECK.

void MosesCmd::OutputBestHypo ( const Moses::TrellisPath path,
long  ,
bool  reportSegmentation,
bool  reportAllFactors,
std::ostream &  out 
)

Definition at line 306 of file IOWrapper.cpp.

References Moses::TrellisPath::GetEdges(), and OutputSurface().

Referenced by main(), and MosesCmd::TranslationTask::Run().

Here is the call graph for this function:

Here is the caller graph for this function:

void MosesCmd::OutputBestSurface ( std::ostream &  out,
const Moses::Hypothesis hypo,
const std::vector< Moses::FactorType > &  outputFactorOrder,
bool  reportSegmentation,
bool  reportAllFactors 
)

void MosesCmd::OutputBestSurface ( std::ostream &  out,
const Hypothesis hypo,
const std::vector< FactorType > &  outputFactorOrder,
bool  reportSegmentation,
bool  reportAllFactors 
)

Definition at line 225 of file IOWrapper.cpp.

References Moses::Hypothesis::GetPrevHypo(), NULL, and OutputSurface().

Referenced by MosesCmd::IOWrapper::OutputBestHypo(), and MosesCmd::TranslationTask::Run().

Here is the call graph for this function:

Here is the caller graph for this function:

void MosesCmd::OutputFeatureScores ( std::ostream &  out,
const ScoreComponentCollection features,
const FeatureFunction ff,
std::string &  lastName 
)

void MosesCmd::OutputFeatureWeightsForHypergraph ( std::ostream &  outputSearchGraphStream  ) 

Definition at line 501 of file Main.cpp.

References Moses::StaticData::GetGenerationDictionaries(), Moses::StaticData::GetPhraseDictionaries(), and OutputFeatureWeightsForHypergraph().

Here is the call graph for this function:

size_t MosesCmd::OutputFeatureWeightsForHypergraph ( size_t  index,
const FeatureFunction ff,
std::ostream &  outputSearchGraphStream 
)

Definition at line 478 of file Main.cpp.

References Moses::FeatureFunction::GetNumScoreComponents(), and Moses::FeatureFunction::GetScoreProducerDescription().

Referenced by main(), and OutputFeatureWeightsForHypergraph().

Here is the call graph for this function:

Here is the caller graph for this function:

void MosesCmd::OutputInput ( std::ostream &  os,
const Hypothesis hypo 
)

Definition at line 347 of file IOWrapper.cpp.

References Moses::Hypothesis::GetInput(), Moses::InputType::GetSize(), and OutputInput().

Here is the call graph for this function:

void MosesCmd::OutputInput ( std::vector< const Phrase * > &  map,
const Hypothesis hypo 
)

void MosesCmd::OutputLatticeMBRNBest ( std::ostream &  out,
const std::vector< LatticeMBRSolution > &  solutions,
long  translationId 
)

void MosesCmd::OutputLatticeMBRNBest ( std::ostream &  out,
const vector< LatticeMBRSolution > &  solutions,
long  translationId 
)

Definition at line 502 of file IOWrapper.cpp.

Referenced by MosesCmd::TranslationTask::Run().

Here is the caller graph for this function:

void MosesCmd::OutputNBest ( std::ostream &  out,
const Moses::TrellisPathList nBestList,
const std::vector< Moses::FactorType > &  outputFactorOrder,
long  translationId,
bool  reportSegmentation 
)

void MosesCmd::OutputSurface ( std::ostream &  out,
const Hypothesis edge,
const std::vector< FactorType > &  outputFactorOrder,
bool  reportSegmentation,
bool  reportAllFactors 
)

Definition at line 194 of file IOWrapper.cpp.

References CHECK, Moses::Hypothesis::GetCurrSourceWordsRange(), Moses::Hypothesis::GetCurrTargetPhrase(), Moses::WordsRange::GetEndPos(), Moses::Phrase::GetSize(), and Moses::WordsRange::GetStartPos().

Referenced by OutputBestHypo(), OutputBestSurface(), and OutputNBest().

Here is the call graph for this function:

Here is the caller graph for this function:

void MosesCmd::pruneLatticeFB ( Lattice &  connectedHyp,
std::map< const Moses::Hypothesis *, std::set< const Moses::Hypothesis * > > &  outgoingHyps,
std::map< const Moses::Hypothesis *, std::vector< Edge > > &  incomingEdges,
const std::vector< float > &  estimatedScores,
const Moses::Hypothesis ,
size_t  edgeDensity,
float  scale 
)

void MosesCmd::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 
)

bool MosesCmd::ReadInput ( IOWrapper &  ioWrapper,
InputTypeEnum  inputType,
InputType *&  source 
)

Definition at line 532 of file IOWrapper.cpp.

References Moses::ConfusionNetworkInput, MosesCmd::IOWrapper::GetInput(), Moses::SentenceInput, TRACE_ERR, and Moses::WordLatticeInput.

Here is the call graph for this function:


Variable Documentation

Definition at line 21 of file LatticeMBR.cpp.

Referenced by calcNgramExpectations(), extract_ngrams(), and getLatticeMBRNBest().

Definition at line 22 of file LatticeMBR.cpp.


Generated on Thu Jun 4 00:32:56 2015 for Moses by  doxygen 1.5.9