mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-29 06:52:34 +03:00
add decoder arg -no-cache for mira tuning
This commit is contained in:
parent
0f3f675698
commit
749bd7fc8f
@ -200,6 +200,9 @@ Parameter::Parameter()
|
||||
AddParam("alternate-weight-setting", "aws", "alternate set of weights to used per xml specification");
|
||||
|
||||
AddParam("placeholder-factor", "Which source factor to use to store the original text for placeholders. The factor must not be used by a translation or gen model");
|
||||
AddParam("no-cache", "Disable all phrase-table caching. Default = false (ie. enable caching)");
|
||||
|
||||
|
||||
}
|
||||
|
||||
Parameter::~Parameter()
|
||||
|
@ -522,6 +522,7 @@ bool StaticData::LoadData(Parameter *parameter)
|
||||
m_registry.Construct(feature, line);
|
||||
}
|
||||
|
||||
NoCache();
|
||||
OverrideFeatures();
|
||||
|
||||
LoadFeatureFunctions();
|
||||
@ -1053,6 +1054,20 @@ bool StaticData::LoadAlternateWeightSettings()
|
||||
return true;
|
||||
}
|
||||
|
||||
void StaticData::NoCache()
|
||||
{
|
||||
bool noCache;
|
||||
SetBooleanParameter( &noCache, "no-cache", false );
|
||||
|
||||
if (noCache) {
|
||||
const std::vector<PhraseDictionary*> &pts = PhraseDictionary::GetColl();
|
||||
for (size_t i = 0; i < pts.size(); ++i) {
|
||||
PhraseDictionary &pt = *pts[i];
|
||||
pt.SetParameter("cache-size", "0");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void StaticData::OverrideFeatures()
|
||||
{
|
||||
const PARAM_VEC ¶ms = m_parameter->GetParam("feature-overwrite");
|
||||
@ -1092,5 +1107,6 @@ void StaticData::CheckLEGACYPT()
|
||||
m_useLegacyPT = false;
|
||||
}
|
||||
|
||||
|
||||
} // namespace
|
||||
|
||||
|
@ -216,6 +216,8 @@ protected:
|
||||
//! load decoding steps
|
||||
bool LoadDecodeGraphs();
|
||||
|
||||
void NoCache();
|
||||
|
||||
bool m_continuePartialTranslation;
|
||||
std::string m_binPath;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user