diff options
author | Patrick Simianer <p@simianer.de> | 2014-02-28 14:09:55 +0100 |
---|---|---|
committer | Patrick Simianer <p@simianer.de> | 2014-02-28 14:09:55 +0100 |
commit | 739a8cd9a92ee10411e352e1677235a8c39ba8b3 (patch) | |
tree | 6ea4e6994d0a8c9fb9750f25f2694f5388a4dfe8 /decoder/decoder.cc | |
parent | ab71c44e61d00c788e84b44156d0be16191e267d (diff) | |
parent | 5675965782e2c9201a7a2fe54b542f5b06d660ef (diff) |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'decoder/decoder.cc')
-rw-r--r-- | decoder/decoder.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/decoder/decoder.cc b/decoder/decoder.cc index e02c7730..31049216 100644 --- a/decoder/decoder.cc +++ b/decoder/decoder.cc @@ -408,7 +408,7 @@ DecoderImpl::DecoderImpl(po::variables_map& conf, int argc, char** argv, istream ("max_translation_sample,X", po::value<int>(), "Sample the max translation from the chart") ("pb_max_distortion,D", po::value<int>()->default_value(4), "Phrase-based decoder: maximum distortion") ("cll_gradient,G","Compute conditional log-likelihood gradient and write to STDOUT (src & ref required)") - ("get_oracle_forest,o", "Calculate rescored hypregraph using approximate BLEU scoring of rules") + ("get_oracle_forest,o", "Calculate rescored hypergraph using approximate BLEU scoring of rules") ("feature_expectations","Write feature expectations for all features in chart (**OBJ** will be the partition)") ("vector_format",po::value<string>()->default_value("b64"), "Sparse vector serialization format for feature expectations or gradients, includes (text or b64)") ("combine_size,C",po::value<int>()->default_value(1), "When option -G is used, process this many sentence pairs before writing the gradient (1=emit after every sentence pair)") @@ -662,11 +662,6 @@ DecoderImpl::DecoderImpl(po::variables_map& conf, int argc, char** argv, istream oracle.show_derivation=conf.count("show_derivations"); remove_intersected_rule_annotations = conf.count("remove_intersected_rule_annotations"); - if (conf.count("extract_rules")) { - stringstream ss; - ss << sent_id; - extract_file.reset(new WriteFile(str("extract_rules",conf)+"/"+ss.str())); - } combine_size = conf["combine_size"].as<int>(); if (combine_size < 1) combine_size = 1; sent_id = -1; @@ -720,6 +715,11 @@ bool DecoderImpl::Decode(const string& input, DecoderObserver* o) { } cerr << " id = " << sent_id << endl; } + if (conf.count("extract_rules")) { + stringstream ss; + ss << sent_id << ".gz"; + extract_file.reset(new WriteFile(str("extract_rules",conf)+"/"+ss.str())); + } string to_translate; Lattice ref; ParseTranslatorInputLattice(buf, &to_translate, &ref); |