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:
Rico Sennrich 2014-12-17 17:35:33 +00:00
parent 710b4bf817
commit 71756cca40
2 changed files with 6 additions and 6 deletions

View File

@ -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);

View File

@ -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") {