2012-07-02 18:57:54 +04:00
|
|
|
#ifndef moses_SearchNormalBatch_h
|
|
|
|
#define moses_SearchNormalBatch_h
|
|
|
|
|
|
|
|
#include "SearchNormal.h"
|
2013-09-25 19:57:01 +04:00
|
|
|
#include "SentenceStats.h"
|
2012-07-02 18:57:54 +04:00
|
|
|
|
|
|
|
namespace Moses
|
|
|
|
{
|
|
|
|
|
|
|
|
class Manager;
|
|
|
|
class InputType;
|
|
|
|
class TranslationOptionCollection;
|
|
|
|
|
2012-07-11 15:30:54 +04:00
|
|
|
/** Implements the phrase-based stack decoding algorithm (no cube pruning) with a twist...
|
|
|
|
* Language model requests are batched together, duplicate requests are removed, and requests are sent together.
|
|
|
|
* Useful for distributed LM where network latency is an issue.
|
2013-05-29 21:16:15 +04:00
|
|
|
*/
|
2012-07-02 18:57:54 +04:00
|
|
|
class SearchNormalBatch: public SearchNormal
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
|
|
|
|
// Added for asynclm decoding.
|
|
|
|
std::vector<const StatelessFeatureFunction*> m_stateless_ffs;
|
|
|
|
std::map<int, LanguageModel*> m_dlm_ffs;
|
2013-05-29 21:16:15 +04:00
|
|
|
std::map<int, StatefulFeatureFunction*> m_stateful_ffs;
|
2012-07-02 18:57:54 +04:00
|
|
|
std::vector<Hypothesis*> m_partial_hypos;
|
2013-09-26 01:08:50 +04:00
|
|
|
uint32_t m_batch_size;
|
2012-07-02 18:57:54 +04:00
|
|
|
int m_max_stack_size;
|
|
|
|
|
|
|
|
// functions for creating hypotheses
|
|
|
|
void ExpandHypothesis(const Hypothesis &hypothesis,const TranslationOption &transOpt, float expectedScore);
|
|
|
|
void EvalAndMergePartialHypos();
|
|
|
|
|
|
|
|
public:
|
|
|
|
SearchNormalBatch(Manager& manager, const InputType &source, const TranslationOptionCollection &transOptColl);
|
|
|
|
~SearchNormalBatch();
|
|
|
|
|
|
|
|
void ProcessSentence();
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|