mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-27 05:55:02 +03:00
make config parameters more consistent with training / other LMs
(target_ngrams=4 source_ngrams=9 is now order=5 source_window=4)
This commit is contained in:
parent
710b4bf817
commit
71756cca40
@ -422,7 +422,7 @@ FFState* BilingualLM::EvaluateWhenApplied(
|
||||
std::vector<int> source_words;
|
||||
source_words.reserve(source_ngrams);
|
||||
std::vector<int> 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);
|
||||
|
@ -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<int>(value);
|
||||
} else if (key == "source_ngrams") {
|
||||
source_ngrams = Scan<int>(value);
|
||||
if (key == "order") {
|
||||
target_ngrams = Scan<int>(value)-1;
|
||||
} else if (key == "source_window") {
|
||||
source_ngrams = Scan<int>(value)*2+1;
|
||||
} else if (key == "factored") {
|
||||
factored = Scan<bool>(value);
|
||||
} else if (key == "pos_factor") {
|
||||
|
Loading…
Reference in New Issue
Block a user