diff options
author | Patrick Simianer <p@simianer.de> | 2015-09-28 09:50:03 +0200 |
---|---|---|
committer | Patrick Simianer <p@simianer.de> | 2015-09-28 09:50:03 +0200 |
commit | d507c07dc60af01a0897df1c6f34df7089cbbd69 (patch) | |
tree | 2ae85ab943ec7604a6bf0b87e972dbab353a029d /training/dtrain/dtrain_net_interface.cc | |
parent | b6d4eef7d31e357bc59e40655123138806535704 (diff) |
output viterbi tree
Diffstat (limited to 'training/dtrain/dtrain_net_interface.cc')
-rw-r--r-- | training/dtrain/dtrain_net_interface.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/training/dtrain/dtrain_net_interface.cc b/training/dtrain/dtrain_net_interface.cc index 38fad160..e21920d0 100644 --- a/training/dtrain/dtrain_net_interface.cc +++ b/training/dtrain/dtrain_net_interface.cc @@ -27,6 +27,7 @@ main(int argc, char** argv) vector<string> dense_features; boost::split(dense_features, conf["dense_features"].as<string>(), boost::is_any_of(" ")); + const bool output_derivation = conf["output_derivation"].as<bool>(); // setup decoder register_feature_functions(); @@ -125,7 +126,11 @@ main(int argc, char** argv) vector<ScoredHyp>* samples = observer->GetSamples(); ostringstream os; cerr << "[dtrain] 1best features " << (*samples)[0].f << endl; - PrintWordIDVec((*samples)[0].w, os); + if (output_derivation) { + os << observer->GetViterbiTreeString() << endl; + } else { + PrintWordIDVec((*samples)[0].w, os); + } sock.send(os.str().c_str(), os.str().size()+1, 0); cerr << "[dtrain] done translating, looping again" << endl; continue; |