diff --git a/moses/LM/BilingualLM.cpp b/moses/LM/BilingualLM.cpp index 7d59fa19c..55dee58e4 100644 --- a/moses/LM/BilingualLM.cpp +++ b/moses/LM/BilingualLM.cpp @@ -422,7 +422,7 @@ FFState* BilingualLM::EvaluateWhenApplied( std::vector source_words; source_words.reserve(source_ngrams); std::vector target_words; - target_words.reserve(target_ngrams); + target_words.reserve(target_ngrams+1); float value = 0; //NeuralLM score const TargetPhrase& currTargetPhrase = cur_hypo.GetCurrTargetPhrase(); @@ -471,7 +471,7 @@ FFState* BilingualLM::EvaluateWhenApplied( } void BilingualLM::SetParameter(const std::string& key, const std::string& value) { - if (key == "filepath") { + if (key == "path") { m_filePath = value; } else { StatefulFeatureFunction::SetParameter(key, value); diff --git a/moses/LM/bilingual-lm/BiLM_NPLM.cpp b/moses/LM/bilingual-lm/BiLM_NPLM.cpp index e1475db10..451aa5ae1 100644 --- a/moses/LM/bilingual-lm/BiLM_NPLM.cpp +++ b/moses/LM/bilingual-lm/BiLM_NPLM.cpp @@ -69,10 +69,10 @@ void BilingualLM_NPLM::initSharedPointer() const { } void BilingualLM_NPLM::SetParameter(const std::string& key, const std::string& value) { - if (key == "target_ngrams") { - target_ngrams = Scan(value); - } else if (key == "source_ngrams") { - source_ngrams = Scan(value); + if (key == "order") { + target_ngrams = Scan(value)-1; + } else if (key == "source_window") { + source_ngrams = Scan(value)*2+1; } else if (key == "factored") { factored = Scan(value); } else if (key == "pos_factor") {