summaryrefslogtreecommitdiff
path: root/decoder/viterbi.cc
diff options
context:
space:
mode:
authorgraehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-07-25 07:37:59 +0000
committergraehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-07-25 07:37:59 +0000
commit410cc38baef914cdc0841a2e8d5a84098e48be49 (patch)
tree5421cec674a71614544ce2705a37e3badc243d70 /decoder/viterbi.cc
parentf234fd50ce8a6f8a006b0f770cca5170a55232f9 (diff)
more comprehensible (but untested) edge/node filtering, awesome per-edge debugging streams
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@407 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'decoder/viterbi.cc')
-rw-r--r--decoder/viterbi.cc10
1 files changed, 3 insertions, 7 deletions
diff --git a/decoder/viterbi.cc b/decoder/viterbi.cc
index d0b7e6ec..7214c600 100644
--- a/decoder/viterbi.cc
+++ b/decoder/viterbi.cc
@@ -13,20 +13,16 @@ std::string viterbi_stats(Hypergraph const& hg, std::string const& name, bool es
if (estring) {
vector<WordID> trans;
const prob_t vs = ViterbiESentence(hg, &trans);
- o<<name<<" Viterbi: "<<log(vs)<<endl;
+ o<<name<<" Viterbi logp: "<<log(vs)<<endl;
o<<name<<" Viterbi: "<<TD::GetString(trans)<<endl;
}
if (etree) {
o<<name<<" tree: "<<ViterbiETree(hg)<<endl;
}
+ //FIXME: this doesn't work.
if (show_derivation) {
o<<name<<" derivation: ";
- ViterbiPathTraversal::Result d;
- Viterbi<ViterbiPathTraversal>(hg, &d);
- if (d.empty())
- o<<"(empty viterbi hyperpath - no translation)";
- else
- hg.show_tree(o,*d.back(),false); // last item should be goal (or at least depend on prev items). TODO: this doesn't actually reorder the nodes in hg.
+ o << hg.show_viterbi_tree(false); // last item should be goal (or at least depend on prev items). TODO: this doesn't actually reorder the nodes in hg.
o<<endl;
}