summaryrefslogtreecommitdiff
path: root/decoder/decoder.cc
diff options
context:
space:
mode:
authorredpony <redpony@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-09-28 17:06:08 +0000
committerredpony <redpony@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-09-28 17:06:08 +0000
commit3db6b004ae1e2319f52862d428c20be5a1538993 (patch)
treeb35c697027afd92324d8d9a63c8e6b27c32d2339 /decoder/decoder.cc
parent521dc2fdbf7eee7d6a86410f490ba7a76691590b (diff)
use boost mpi, fix L1 stochastic optimizer
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@659 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'decoder/decoder.cc')
-rw-r--r--decoder/decoder.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/decoder/decoder.cc b/decoder/decoder.cc
index 1a233fc5..537fdffa 100644
--- a/decoder/decoder.cc
+++ b/decoder/decoder.cc
@@ -147,6 +147,7 @@ struct DecoderImpl {
void SetWeights(const vector<double>& weights) {
feature_weights = weights;
}
+ void SetId(int next_sent_id) { sent_id = next_sent_id - 1; }
void forest_stats(Hypergraph &forest,string name,bool show_tree,bool show_features,WeightVector *weights=0,bool show_deriv=false) {
cerr << viterbi_stats(forest,name,true,show_tree,show_deriv);
@@ -622,6 +623,7 @@ DecoderImpl::DecoderImpl(po::variables_map& conf, int argc, char** argv, istream
Decoder::Decoder(istream* cfg) { pimpl_.reset(new DecoderImpl(conf,0,0,cfg)); }
Decoder::Decoder(int argc, char** argv) { pimpl_.reset(new DecoderImpl(conf,argc, argv, 0)); }
Decoder::~Decoder() {}
+void Decoder::SetId(int next_sent_id) { pimpl_->SetId(next_sent_id); }
bool Decoder::Decode(const string& input, DecoderObserver* o) {
bool del = false;
if (!o) { o = new DecoderObserver; del = true; }
@@ -818,8 +820,7 @@ bool DecoderImpl::Decode(const string& input, DecoderObserver* o) {
HypergraphIO::WriteAsCFG(forest);
if (has_ref) {
if (HG::Intersect(ref, &forest)) {
- if (!SILENT) cerr << " Constr. forest (nodes/edges): " << forest.nodes_.size() << '/' << forest.edges_.size() << endl;
- if (!SILENT) cerr << " Constr. forest (paths): " << forest.NumberOfPaths() << endl;
+ if (!SILENT) forest_stats(forest," Constr. forest",show_tree_structure,show_features,feature_weights,oracle.show_derivation);
if (crf_uniform_empirical) {
if (!SILENT) cerr << " USING UNIFORM WEIGHTS\n";
for (int i = 0; i < forest.edges_.size(); ++i)