mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-27 14:05:29 +03:00
tell create-ini about input factors
This commit is contained in:
parent
a87316a635
commit
3271710dd5
@ -18,6 +18,7 @@ using namespace std;
|
||||
string iniPath;
|
||||
vector<FF*> ffVec;
|
||||
bool isHierarchical = false;
|
||||
int inputFactorMax = 0;
|
||||
|
||||
void OutputIni();
|
||||
void ParseFactors(const string &line, vector< pair<Factors, Factors> > &ret);
|
||||
@ -76,6 +77,10 @@ int main(int argc, char **argv)
|
||||
++i;
|
||||
ParseFactors(argv[i], roFactors);
|
||||
}
|
||||
else if (key == "-input-factor-max") {
|
||||
++i;
|
||||
inputFactorMax = Scan<int>(argv[i]);
|
||||
}
|
||||
|
||||
else {
|
||||
cerr << "Unknown arg " << key << endl;
|
||||
@ -129,7 +134,10 @@ void OutputIni()
|
||||
weightStrme << "\n\n[weight]" << endl;
|
||||
|
||||
strme << "[input-factors]" << endl;
|
||||
strme << "0" << endl;
|
||||
for (size_t i = 0; i <= inputFactorMax; ++i) {
|
||||
strme << i << endl;
|
||||
}
|
||||
strme << endl;
|
||||
|
||||
strme << "[mapping]" << endl;
|
||||
if (isHierarchical) {
|
||||
|
@ -2087,6 +2087,9 @@ sub define_training_create_config {
|
||||
|
||||
my %IN = &get_factor_id("input");
|
||||
my %OUT = &get_factor_id("output");
|
||||
|
||||
$cmd .= "-input-factor-max ".((scalar keys %IN)-1)." ";
|
||||
|
||||
$cmd .= "-translation-factors ".
|
||||
&encode_factor_definition("translation-factors",\%IN,\%OUT)." ";
|
||||
$cmd .= "-reordering-factors ".
|
||||
|
Loading…
Reference in New Issue
Block a user