From 7b8cbb7f43c34c9e068f041ffe9e6fdeebc0c901 Mon Sep 17 00:00:00 2001 From: Patrick Simianer Date: Tue, 20 Jan 2015 18:04:32 +0100 Subject: word-aligner: init_ttable --- word-aligner/fast_align.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'word-aligner') diff --git a/word-aligner/fast_align.cc b/word-aligner/fast_align.cc index 73b72399..d320fb52 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(), "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(), "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()->default_value(1), "When --force_align, use this source length multiplier"); + ("mean_srclen_multiplier,m",po::value()->default_value(1), "When --force_align, use this source length multiplier") + ("init_ttable,J",po::value()->default_value(""), "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(), "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(); } + + if (conf.count("init_ttable")) { + ReadFile s2t_f(conf["force_align"].as()); + s2t.DeserializeLogProbsFromText(s2t_f.stream()); + } for (int iter = 0; iter < ITERATIONS; ++iter) { const bool final_iteration = (iter == (ITERATIONS - 1)); -- cgit v1.2.3