diff options
author | Chris Dyer <cdyer@Chris-Dyers-MacBook-Pro.local> | 2010-12-07 22:01:41 -0500 |
---|---|---|
committer | Chris Dyer <cdyer@Chris-Dyers-MacBook-Pro.local> | 2010-12-07 22:01:41 -0500 |
commit | 61bfaf15c02a0555d8ffa5dd4e6ae32f09354610 (patch) | |
tree | c04f122970bb769e5e3f67989e5e02adf774d06c | |
parent | 670356efa26cd3bba3bf7047701e9fad1aeed0cb (diff) |
add support for viterbi alignment
-rw-r--r-- | decoder/decoder.cc | 3 |
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; |