summaryrefslogtreecommitdiff
path: root/decoder/decoder.cc
diff options
context:
space:
mode:
authorJonathan Clark <jon.h.clark@gmail.com>2011-03-10 06:54:59 -0500
committerJonathan Clark <jon.h.clark@gmail.com>2011-03-10 06:54:59 -0500
commit187a7282671bdcee26ade95abcca5282e925c362 (patch)
treed62eb5b7653b7dbc949d0de3b6b15642fe8912bf /decoder/decoder.cc
parentee0efe4d807aef64117776a476eeaeca98287315 (diff)
parent19e0a382269042605c347b48e5ac92c5012f1ccc (diff)
Merge branch 'master' of git://github.com/redpony/cdec
Diffstat (limited to 'decoder/decoder.cc')
-rw-r--r--decoder/decoder.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/decoder/decoder.cc b/decoder/decoder.cc
index 239c8620..95ff6270 100644
--- a/decoder/decoder.cc
+++ b/decoder/decoder.cc
@@ -763,10 +763,6 @@ bool DecoderImpl::Decode(const string& input, DecoderObserver* o) {
PRWeightFunction<double, EdgeProb, double, ELengthWeightFunction> >(forest);
cerr << " Expected length (words): " << res.r / res.p << "\t" << res << endl;
}
- if (conf.count("show_partition")) {
- const prob_t z = Inside<prob_t, EdgeProb>(forest);
- cerr << " Init. partition log(Z): " << log(z) << endl;
- }
for (int pass = 0; pass < rescoring_passes.size(); ++pass) {
const RescoringPass& rp = rescoring_passes[pass];
@@ -793,6 +789,11 @@ bool DecoderImpl::Decode(const string& input, DecoderObserver* o) {
if (!SILENT) forest_stats(forest," " + passtr +" forest",show_tree_structure,show_features,cur_weights,oracle.show_derivation);
}
+ if (conf.count("show_partition")) {
+ const prob_t z = Inside<prob_t, EdgeProb>(forest);
+ cerr << " " << passtr << " partition log(Z): " << log(z) << endl;
+ }
+
string fullbp = "beam_prune" + StringSuffixForRescoringPass(pass);
string fulldp = "density_prune" + StringSuffixForRescoringPass(pass);
maybe_prune(forest,conf,fullbp.c_str(),fulldp.c_str(),passtr,srclen);