diff options
Diffstat (limited to 'word-aligner/fast_align.cc')
-rw-r--r-- | word-aligner/fast_align.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/word-aligner/fast_align.cc b/word-aligner/fast_align.cc index 73b72399..a3b346ec 100644 --- a/word-aligner/fast_align.cc +++ b/word-aligner/fast_align.cc @@ -43,7 +43,8 @@ bool InitCommandLine(int argc, char** argv, po::variables_map* conf) { ("testset,x", po::value<string>(), "After training completes, compute the log likelihood of this set of sentence pairs under the learned model") ("no_add_viterbi,V","When writing model parameters, do not add Viterbi alignment points (may generate a grammar where some training sentence pairs are unreachable)") ("force_align,f",po::value<string>(), "Load previously written parameters to 'force align' input. Set --diagonal_tension and --mean_srclen_multiplier as estimated during training.") - ("mean_srclen_multiplier,m",po::value<double>()->default_value(1), "When --force_align, use this source length multiplier"); + ("mean_srclen_multiplier,m",po::value<double>()->default_value(1), "When --force_align, use this source length multiplier") + ("init_ttable,J",po::value<string>(), "Initialize ttable with this file (output of -p). Also give --diagonal_tension."); po::options_description clo("Command line options"); clo.add_options() ("config", po::value<string>(), "Configuration file") @@ -109,6 +110,11 @@ int main(int argc, char** argv) { s2t.DeserializeLogProbsFromText(s2t_f.stream()); mean_srclen_multiplier = conf["mean_srclen_multiplier"].as<double>(); } + + if (conf.count("init_ttable")) { + ReadFile s2t_f(conf["init_ttable"].as<string>()); + s2t.DeserializeLogProbsFromText(s2t_f.stream()); + } for (int iter = 0; iter < ITERATIONS; ++iter) { const bool final_iteration = (iter == (ITERATIONS - 1)); |