From 70114f58324ff60de3d77a42d299e3bcf2c37450 Mon Sep 17 00:00:00 2001 From: graehl Date: Thu, 1 Jul 2010 23:08:34 +0000 Subject: factor forest stats (show size post pruning, and portion kept) and cdec --scale_prune_srclen git-svn-id: https://ws10smt.googlecode.com/svn/trunk@96 ec762483-ff6d-05da-a07a-a48fb63a330f --- decoder/viterbi.cc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'decoder/viterbi.cc') diff --git a/decoder/viterbi.cc b/decoder/viterbi.cc index 582dc5b2..7f52d08c 100644 --- a/decoder/viterbi.cc +++ b/decoder/viterbi.cc @@ -6,6 +6,23 @@ using namespace std; +std::string viterbi_stats(Hypergraph const& hg, std::string const& name, bool estring, bool etree) +{ + ostringstream o; + o << hg.stats(name); + if (estring) { + vector trans; + const prob_t vs = ViterbiESentence(hg, &trans); + o< tmp; const prob_t p = Viterbi, ETreeTraversal, prob_t, EdgeProb>(hg, &tmp); -- cgit v1.2.3