summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2015-01-20 19:46:50 +0100
committerPatrick Simianer <p@simianer.de>2015-01-20 19:46:50 +0100
commit3dcf749695b64954eef081f81043d9f4a5e37b64 (patch)
treecc78f7aa5648520e34880db6541e0500e46c8d92
parent7b8cbb7f43c34c9e068f041ffe9e6fdeebc0c901 (diff)
fix
-rw-r--r--training/dtrain/dtrain.cc7
-rw-r--r--word-aligner/fast_align.cc4
2 files changed, 6 insertions, 5 deletions
diff --git a/training/dtrain/dtrain.cc b/training/dtrain/dtrain.cc
index ccb50af2..823a50de 100644
--- a/training/dtrain/dtrain.cc
+++ b/training/dtrain/dtrain.cc
@@ -311,7 +311,7 @@ main(int argc, char** argv)
{
string in;
- string ref;
+ vector<string> ref;
bool next = false, stop = false; // next iteration or premature stop
if (t == 0) {
if(!getline(*input, in)) next = true;
@@ -319,7 +319,8 @@ main(int argc, char** argv)
vector<string> strs;
boost::algorithm::split_regex(strs, in, boost::regex(" \\|\\|\\| "));
in = strs[0];
- ref = strs[1];
+ strs.erase(strs.begin());
+ ref = strs;
}
} else {
if (ii == in_sz) next = true; // stop if we reach the end of our input
@@ -355,7 +356,7 @@ main(int argc, char** argv)
lambdas.init_vector(&decoder_weights);
// getting input
- vector<WordID> ref_ids; // reference as vector<WordID>
+ vector<vector<WordID> ref_ids; // reference as vector<WordID>
if (t == 0) {
if (!read_bitext) {
getline(*refs, ref);
diff --git a/word-aligner/fast_align.cc b/word-aligner/fast_align.cc
index d320fb52..a3b346ec 100644
--- a/word-aligner/fast_align.cc
+++ b/word-aligner/fast_align.cc
@@ -44,7 +44,7 @@ bool InitCommandLine(int argc, char** argv, po::variables_map* conf) {
("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")
- ("init_ttable,J",po::value<string>()->default_value(""), "Initialize ttable with this file (output of -p). Also give --diagonal_tension.");
+ ("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")
@@ -112,7 +112,7 @@ int main(int argc, char** argv) {
}
if (conf.count("init_ttable")) {
- ReadFile s2t_f(conf["force_align"].as<string>());
+ ReadFile s2t_f(conf["init_ttable"].as<string>());
s2t.DeserializeLogProbsFromText(s2t_f.stream());
}