diff options
author | Patrick Simianer <p@simianer.de> | 2015-10-20 13:50:29 +0200 |
---|---|---|
committer | Patrick Simianer <p@simianer.de> | 2015-10-20 13:50:29 +0200 |
commit | 5cc7ce74d79bb6b2f7d04305cef47374d857b603 (patch) | |
tree | b6d29b6372568bc5c11a89ec238947a359698507 | |
parent | d507c07dc60af01a0897df1c6f34df7089cbbd69 (diff) |
small fix
-rw-r--r-- | training/dtrain/dtrain_net_interface.cc | 2 | ||||
-rw-r--r-- | training/dtrain/sample_net_interface.h | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/training/dtrain/dtrain_net_interface.cc b/training/dtrain/dtrain_net_interface.cc index e21920d0..6d24bb7b 100644 --- a/training/dtrain/dtrain_net_interface.cc +++ b/training/dtrain/dtrain_net_interface.cc @@ -127,7 +127,7 @@ main(int argc, char** argv) ostringstream os; cerr << "[dtrain] 1best features " << (*samples)[0].f << endl; if (output_derivation) { - os << observer->GetViterbiTreeString() << endl; + os << observer->GetViterbiTreeStr() << endl; } else { PrintWordIDVec((*samples)[0].w, os); } diff --git a/training/dtrain/sample_net_interface.h b/training/dtrain/sample_net_interface.h index affcd0d6..a2b5f87d 100644 --- a/training/dtrain/sample_net_interface.h +++ b/training/dtrain/sample_net_interface.h @@ -17,6 +17,7 @@ struct ScoredKbest : public DecoderObserver vector<Ngrams>* ref_ngs_; vector<size_t>* ref_ls_; bool dont_score; + string viterbiTreeStr_; ScoredKbest(const size_t k, PerSentenceBleuScorer* scorer) : k_(k), scorer_(scorer), dont_score(false) {} @@ -42,6 +43,7 @@ struct ScoredKbest : public DecoderObserver samples_.push_back(h); effective_sz_++; feature_count_ += h.f.size(); + viterbiTreeStr_ = hg->show_viterbi_tree(false); } } @@ -53,6 +55,7 @@ struct ScoredKbest : public DecoderObserver } inline size_t GetFeatureCount() { return feature_count_; } inline size_t GetSize() { return effective_sz_; } + inline string GetViterbiTreeStr() { return viterbiTreeStr_; } }; } // namespace |