Mira::MosesDecoder Class Reference

#include <Decoder.h>

Collaboration diagram for Mira::MosesDecoder:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 MosesDecoder (const std::string &inifile, int debuglevel, int argc, std::vector< std::string > decoder_params)
std::vector< std::vector
< const Moses::Word * > > 
getNBest (const std::string &source, size_t sentenceid, size_t nbestSize, float bleuObjectiveweight, float bleuScoreWeight, std::vector< Moses::ScoreComponentCollection > &featureValues, std::vector< float > &bleuScores, std::vector< float > &modelScores, size_t numReturnedTranslations, bool realBleu, bool distinct, bool avgRefLength, size_t rank, size_t epoch, std::string filename)
std::vector< std::vector
< const Moses::Word * > > 
runDecoder (const std::string &source, size_t sentenceid, size_t nbestSize, float bleuObjectiveweight, float bleuScoreWeight, std::vector< Moses::ScoreComponentCollection > &featureValues, std::vector< float > &bleuScores, std::vector< float > &modelScores, size_t numReturnedTranslations, bool realBleu, bool distinct, size_t rank, size_t epoch, Moses::SearchAlgorithm &seach, std::string filename)
std::vector< std::vector
< const Moses::Word * > > 
runChartDecoder (const std::string &source, size_t sentenceid, size_t nbestSize, float bleuObjectiveweight, float bleuScoreWeight, std::vector< Moses::ScoreComponentCollection > &featureValues, std::vector< float > &bleuScores, std::vector< float > &modelScores, size_t numReturnedTranslations, bool realBleu, bool distinct, size_t rank, size_t epoch)
void outputNBestList (const std::string &source, size_t sentenceid, size_t nBestSize, float bleuObjectiveWeight, float bleuScoreWeight, bool distinctNbest, bool avgRefLength, std::string filename, std::ofstream &streamOut)
void initialize (Moses::StaticData &staticData, const std::string &source, size_t sentenceid, float bleuObjectiveWeight, float bleuScoreWeight, bool avgRefLength, bool chartDecoding)
void updateHistory (const std::vector< const Moses::Word * > &words)
void updateHistory (const std::vector< std::vector< const Moses::Word * > > &words, std::vector< size_t > &sourceLengths, std::vector< size_t > &ref_ids, size_t rank, size_t epoch)
void printBleuFeatureHistory (std::ostream &out)
void printReferenceLength (const std::vector< size_t > &ref_ids)
size_t getReferenceLength (size_t ref_id)
size_t getClosestReferenceLength (size_t ref_id, int hypoLength)
size_t getShortestReferenceIndex (size_t ref_id)
void setBleuParameters (bool disable, bool sentenceBleu, bool scaleByInputLength, bool scaleByAvgInputLength, bool scaleByInverseLength, bool scaleByAvgInverseLength, float scaleByX, float historySmoothing, size_t scheme, bool simpleHistoryBleu)
void setAvgInputLength (float l)
Moses::ScoreComponentCollection getWeights ()
void setWeights (const Moses::ScoreComponentCollection &weights)
void cleanup (bool chartDecoding)
float getSourceLengthHistory ()
float getTargetLengthHistory ()
float getAverageInputLength ()


Detailed Description

Wraps moses decoder.

Definition at line 45 of file Decoder.h.


Constructor & Destructor Documentation

Mira::MosesDecoder::MosesDecoder ( const std::string &  inifile,
int  debuglevel,
int  argc,
std::vector< std::string >  decoder_params 
)

Initialise moses (including StaticData) using the given ini file and debuglevel, passing through any other command line arguments.


Member Function Documentation

void Mira::MosesDecoder::cleanup ( bool  chartDecoding  ) 

Definition at line 83 of file Decoder.cpp.

Referenced by decodeHopeOrFear(), and main().

Here is the caller graph for this function:

float Mira::MosesDecoder::getAverageInputLength (  )  [inline]

Definition at line 132 of file Decoder.h.

References Moses::BleuScoreFeature::GetAverageInputLength().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

size_t Mira::MosesDecoder::getClosestReferenceLength ( size_t  ref_id,
int  hypoLength 
)

Definition at line 382 of file Decoder.cpp.

References Moses::BleuScoreFeature::GetClosestRefLength().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

std::vector< std::vector<const Moses::Word*> > Mira::MosesDecoder::getNBest ( const std::string &  source,
size_t  sentenceid,
size_t  nbestSize,
float  bleuObjectiveweight,
float  bleuScoreWeight,
std::vector< Moses::ScoreComponentCollection > &  featureValues,
std::vector< float > &  bleuScores,
std::vector< float > &  modelScores,
size_t  numReturnedTranslations,
bool  realBleu,
bool  distinct,
bool  avgRefLength,
size_t  rank,
size_t  epoch,
std::string  filename 
)

Referenced by decodeHopeOrFear(), and main().

Here is the caller graph for this function:

size_t Mira::MosesDecoder::getReferenceLength ( size_t  ref_id  ) 

size_t Mira::MosesDecoder::getShortestReferenceIndex ( size_t  ref_id  ) 

Definition at line 387 of file Decoder.cpp.

References Moses::BleuScoreFeature::GetShortestRefIndex().

Here is the call graph for this function:

float Mira::MosesDecoder::getSourceLengthHistory (  )  [inline]

Definition at line 126 of file Decoder.h.

References Moses::BleuScoreFeature::GetSourceLengthHistory().

Here is the call graph for this function:

float Mira::MosesDecoder::getTargetLengthHistory (  )  [inline]

Definition at line 129 of file Decoder.h.

References Moses::BleuScoreFeature::GetTargetLengthHistory().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

ScoreComponentCollection Mira::MosesDecoder::getWeights (  ) 

Definition at line 357 of file Decoder.cpp.

Referenced by main().

Here is the caller graph for this function:

void Mira::MosesDecoder::initialize ( Moses::StaticData staticData,
const std::string &  source,
size_t  sentenceid,
float  bleuObjectiveWeight,
float  bleuScoreWeight,
bool  avgRefLength,
bool  chartDecoding 
)

void Mira::MosesDecoder::outputNBestList ( const std::string &  source,
size_t  sentenceid,
size_t  nBestSize,
float  bleuObjectiveWeight,
float  bleuScoreWeight,
bool  distinctNbest,
bool  avgRefLength,
std::string  filename,
std::ofstream &  streamOut 
)

void Mira::MosesDecoder::printBleuFeatureHistory ( std::ostream &  out  ) 

Definition at line 377 of file Decoder.cpp.

References Moses::BleuScoreFeature::PrintHistory().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

void Mira::MosesDecoder::printReferenceLength ( const std::vector< size_t > &  ref_ids  ) 

std::vector< std::vector<const Moses::Word*> > Mira::MosesDecoder::runChartDecoder ( const std::string &  source,
size_t  sentenceid,
size_t  nbestSize,
float  bleuObjectiveweight,
float  bleuScoreWeight,
std::vector< Moses::ScoreComponentCollection > &  featureValues,
std::vector< float > &  bleuScores,
std::vector< float > &  modelScores,
size_t  numReturnedTranslations,
bool  realBleu,
bool  distinct,
size_t  rank,
size_t  epoch 
)

std::vector< std::vector<const Moses::Word*> > Mira::MosesDecoder::runDecoder ( const std::string &  source,
size_t  sentenceid,
size_t  nbestSize,
float  bleuObjectiveweight,
float  bleuScoreWeight,
std::vector< Moses::ScoreComponentCollection > &  featureValues,
std::vector< float > &  bleuScores,
std::vector< float > &  modelScores,
size_t  numReturnedTranslations,
bool  realBleu,
bool  distinct,
size_t  rank,
size_t  epoch,
Moses::SearchAlgorithm seach,
std::string  filename 
)

void Mira::MosesDecoder::setAvgInputLength ( float  l  )  [inline]

Definition at line 119 of file Decoder.h.

References Moses::BleuScoreFeature::SetAvgInputLength().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

void Mira::MosesDecoder::setBleuParameters ( bool  disable,
bool  sentenceBleu,
bool  scaleByInputLength,
bool  scaleByAvgInputLength,
bool  scaleByInverseLength,
bool  scaleByAvgInverseLength,
float  scaleByX,
float  historySmoothing,
size_t  scheme,
bool  simpleHistoryBleu 
)

Definition at line 392 of file Decoder.cpp.

References Moses::BleuScoreFeature::SetBleuParameters().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

void Mira::MosesDecoder::setWeights ( const Moses::ScoreComponentCollection weights  ) 

Definition at line 362 of file Decoder.cpp.

Referenced by main().

Here is the caller graph for this function:

void Mira::MosesDecoder::updateHistory ( const std::vector< std::vector< const Moses::Word * > > &  words,
std::vector< size_t > &  sourceLengths,
std::vector< size_t > &  ref_ids,
size_t  rank,
size_t  epoch 
)

void Mira::MosesDecoder::updateHistory ( const std::vector< const Moses::Word * > &  words  ) 

Referenced by main().

Here is the caller graph for this function:


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

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