summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Dyer <cdyer@Chris-Dyers-MacBook-Pro.local>2010-12-07 22:01:41 -0500
committerChris Dyer <cdyer@Chris-Dyers-MacBook-Pro.local>2010-12-07 22:01:41 -0500
commita80c69d266886d9911eb91833811d7f8393ac64d (patch)
tree719df29fdd4d78c8e7fd7016380e7dd70b759bc0
parenta50b6162b1c5b18473db9de98aa1fa73620b9af9 (diff)
add support for viterbi alignment
-rw-r--r--decoder/decoder.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/decoder/decoder.cc b/decoder/decoder.cc
index f47b7385..fb219663 100644
--- a/decoder/decoder.cc
+++ b/decoder/decoder.cc
@@ -340,6 +340,7 @@ DecoderImpl::DecoderImpl(po::variables_map& conf, int argc, char** argv, istream
("k_best,k",po::value<int>(),"Extract the k best derivations")
("unique_k_best,r", "Unique k-best translation list")
("aligner,a", "Run as a word/phrase aligner (src & ref required)")
+ ("aligner_use_viterbi", "If run in alignment mode, compute the Viterbi (rather than MAP) alignment")
("intersection_strategy,I",po::value<string>()->default_value("cube_pruning"), "Intersection strategy for incorporating finite-state features; values include Cube_pruning, Full")
("cubepruning_pop_limit,K",po::value<int>()->default_value(200), "Max number of pops from the candidate heap at each node")
("goal",po::value<string>()->default_value("S"),"Goal symbol (SCFG & FST)")
@@ -869,7 +870,7 @@ bool DecoderImpl::Decode(const string& input, DecoderObserver* o) {
}
}
if (aligner_mode && !output_training_vector)
- AlignerTools::WriteAlignment(smeta.GetSourceLattice(), smeta.GetReference(), forest, &cout);
+ AlignerTools::WriteAlignment(smeta.GetSourceLattice(), smeta.GetReference(), forest, &cout, 0 == conf.count("aligner_use_viterbi"));
if (write_gradient) {
const prob_t ref_z = InsideOutside<prob_t, EdgeProb, SparseVector<prob_t>, EdgeFeaturesAndProbWeightFunction>(forest, &ref_exp);
ref_exp /= ref_z;