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:
authorDavid Madl <git@abanbytes.eu>2015-11-10 18:07:06 +0300
committerDavid Madl <git@abanbytes.eu>2015-11-17 19:15:13 +0300
commite36fb96557d0079e88eef4fc2f38147ff9455b0c (patch)
tree9a58a748cc49d9ad400241d30c14963765180769 /moses/Incremental.cpp
parent3b6393094394cd19eee61b64e467b055a88033d4 (diff)
LanguageModel, KenLM: avoid StaticData usage
* drop global lmodel-oov-feature option, and add it to LM FF config line instead use oov-feature=1 (bool) option instead * drop LanguageModel::GetWeight() * KenLM: use m_verbosity of FF instead of IFVERBOSE macro which uses StaticData * train-model.perl: move language model OOV feature onto LM feature spec line
Diffstat (limited to 'moses/Incremental.cpp')
-rw-r--r--moses/Incremental.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/moses/Incremental.cpp b/moses/Incremental.cpp
index 15ef1ad71..d2d44d95c 100644
--- a/moses/Incremental.cpp
+++ b/moses/Incremental.cpp
@@ -229,11 +229,12 @@ Manager::
PopulateBest(const Model &model, const std::vector<lm::WordIndex> &words, Best &out)
{
const LanguageModel &abstract = LanguageModel::GetFirstLM();
- const float oov_weight = abstract.OOVFeatureEnabled() ? abstract.GetOOVWeight() : 0.0;
const StaticData &data = StaticData::Instance();
+ const float lm_weight = data.GetWeights(&abstract)[0];
+ const float oov_weight = abstract.OOVFeatureEnabled() ? data.GetWeights(&abstract)[1] : 0.0;
size_t cpl = data.options().cube.pop_limit;
size_t nbs = data.options().nbest.nbest_size;
- search::Config config(abstract.GetWeight() * log_10, cpl, search::NBestConfig(nbs));
+ search::Config config(lm_weight * log_10, cpl, search::NBestConfig(nbs));
search::Context<Model> context(config, model);
size_t size = m_source.GetSize();