Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHieu Hoang <hieuhoang@gmail.com>2012-11-12 23:56:18 +0400
committerHieu Hoang <hieuhoang@gmail.com>2012-11-12 23:56:18 +0400
commit5e3ef23cef6101d2c098eb3445f562e8f595655b (patch)
treeb8c332b6fa82bae84ea4910967a10ba1b08a7107 /moses/SearchNormalBatch.h
parent8c785cff2b1be3cccd76ea9026f71b649762dfc3 (diff)
move moses/src/* to moses/
Diffstat (limited to 'moses/SearchNormalBatch.h')
-rw-r--r--moses/SearchNormalBatch.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/moses/SearchNormalBatch.h b/moses/SearchNormalBatch.h
new file mode 100644
index 000000000..fcfda7054
--- /dev/null
+++ b/moses/SearchNormalBatch.h
@@ -0,0 +1,43 @@
+#ifndef moses_SearchNormalBatch_h
+#define moses_SearchNormalBatch_h
+
+#include "SearchNormal.h"
+
+namespace Moses
+{
+
+class Manager;
+class InputType;
+class TranslationOptionCollection;
+
+/** 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.
+ */
+class SearchNormalBatch: public SearchNormal
+{
+protected:
+
+ // Added for asynclm decoding.
+ std::vector<const StatelessFeatureFunction*> m_stateless_ffs;
+ std::map<int, LanguageModel*> m_dlm_ffs;
+ std::map<int, StatefulFeatureFunction*> m_stateful_ffs;
+ std::vector<Hypothesis*> m_partial_hypos;
+ int m_batch_size;
+ 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