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
path: root/moses
diff options
context:
space:
mode:
authorEva Hasler <ehasler@saxnot.inf.ed.ac.uk>2012-05-18 21:59:10 +0400
committerEva Hasler <ehasler@saxnot.inf.ed.ac.uk>2012-05-18 21:59:10 +0400
commit9e69a12b0295d4b83035e23c5151cc62c59016fd (patch)
tree7029f93c30e2a6cfa19f4643b851709c05e72226 /moses
parent4f766434866345c3b59f2c8b690a67504ab7cc5a (diff)
update glmu feature
Diffstat (limited to 'moses')
-rwxr-xr-xmoses/src/Parameter.cpp10
-rwxr-xr-xmoses/src/StaticData.cpp7
2 files changed, 9 insertions, 8 deletions
diff --git a/moses/src/Parameter.cpp b/moses/src/Parameter.cpp
index 0815f6f2d..64b842074 100755
--- a/moses/src/Parameter.cpp
+++ b/moses/src/Parameter.cpp
@@ -51,7 +51,7 @@ Parameter::Parameter()
AddParam("factor-delimiter", "fd", "specify a different factor delimiter than the default");
AddParam("generation-file", "location and properties of the generation table");
AddParam("global-lexical-file", "gl", "discriminatively trained global lexical translation model file");
- AddParam("glm-model", "Factor types for global lexicon models, format Factor-Factor.");
+ AddParam("glm-feature", "discriminatively trained global lexical translation feature, sparse producer");
AddParam("input-factors", "list of factors in the input");
AddParam("input-file", "i", "location of the input file to be translated");
AddParam("inputtype", "text (0), confusion network (1), word lattice (2) (default = 0)");
@@ -97,10 +97,10 @@ Parameter::Parameter()
AddParam("weight-i", "I", "weight(s) for word insertion - used for parameters from confusion network and lattice input links");
AddParam("weight-l", "lm", "weight(s) for language models");
AddParam("weight-lex", "lex", "weight for global lexical model");
- AddParam("weight-glm", "glm", "weight for global lexical model");
- AddParam("weight-wt", "wt", "weight for global lexical model");
- AddParam("weight-pp", "pp", "weight for global lexical model");
- AddParam("weight-pb", "pb", "weight for global lexical model");
+ AddParam("weight-glm", "glm", "weight for global lexical feature, sparse producer");
+ AddParam("weight-wt", "wt", "weight for word translation feature");
+ AddParam("weight-pp", "pp", "weight for phrase pair feature");
+ AddParam("weight-pb", "pb", "weight for phrase boundary feature");
AddParam("weight-t", "tm", "weights for translation model components");
AddParam("weight-w", "w", "weight for word penalty");
AddParam("weight-u", "u", "weight for unknown word penalty");
diff --git a/moses/src/StaticData.cpp b/moses/src/StaticData.cpp
index 9c02e48e6..90418ace4 100755
--- a/moses/src/StaticData.cpp
+++ b/moses/src/StaticData.cpp
@@ -1042,7 +1042,7 @@ bool StaticData::LoadGlobalLexicalModel()
bool StaticData::LoadGlobalLexicalModelUnlimited()
{
const vector<float> &weight = Scan<float>(m_parameter->GetParam("weight-glm"));
- const vector<string> &modelSpec = m_parameter->GetParam("glm-model");
+ const vector<string> &modelSpec = m_parameter->GetParam("glm-feature");
if (weight.size() != 0 && weight.size() != modelSpec.size()) {
std::cerr << "number of sparse producer weights and model specs for the global lexical model unlimited "
@@ -1060,7 +1060,7 @@ bool StaticData::LoadGlobalLexicalModelUnlimited()
// read optional punctuation and bias specifications
if (spec.size() > 0) {
if (spec.size() != 2 && spec.size() != 3 && spec.size() != 4 && spec.size() != 6) {
- UserMessage::Add("Format of glm feature is <factor-src> <factor-tgt> [ignore-punct] [use-bias] "
+ UserMessage::Add("Format of glm feature is <factor-src>-<factor-tgt> [ignore-punct] [use-bias] "
"[context-type] [filename-src filename-tgt]");
return false;
}
@@ -1097,7 +1097,8 @@ bool StaticData::LoadGlobalLexicalModelUnlimited()
return false;
}
}
- m_globalLexicalModelsUnlimited[i]->SetSparseProducerWeight(weight[i]);
+ if (weight.size() > i)
+ m_globalLexicalModelsUnlimited[i]->SetSparseProducerWeight(weight[i]);
}
return true;
}