From 904130a611019d3ecb7878e21035f6915b4b5702 Mon Sep 17 00:00:00 2001 From: graehl Date: Mon, 19 Jul 2010 22:51:33 +0000 Subject: shared_ptr for scores. todo: intrusive. git-svn-id: https://ws10smt.googlecode.com/svn/trunk@327 ec762483-ff6d-05da-a07a-a48fb63a330f --- vest/mr_vest_generate_mapper_input.cc | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) (limited to 'vest/mr_vest_generate_mapper_input.cc') diff --git a/vest/mr_vest_generate_mapper_input.cc b/vest/mr_vest_generate_mapper_input.cc index 5b513f9b..f66b5082 100644 --- a/vest/mr_vest_generate_mapper_input.cc +++ b/vest/mr_vest_generate_mapper_input.cc @@ -99,7 +99,6 @@ struct oracle_directions { ("fear_to_hope,f",po::bool_switch(&fear_to_hope),"for each of the oracle_directions, also include a direction from fear to hope (as well as origin to hope)") ("no_old_to_hope","don't emit the usual old -> hope oracle") ("decoder_translations",po::value(&decoder_translations_file)->default_value(""),"one per line decoder 1best translations for computing document BLEU vs. sentences-seen-so-far BLEU") - ("verbose",po::bool_switch(&verbose),"detailed logs") ; } void InitCommandLine(int argc, char *argv[], po::variables_map *conf) { @@ -133,6 +132,7 @@ struct oracle_directions { } UseConf(*conf); + verbose=oracle.verbose; return; bad_cmdline: cerr << dcmdline_options << endl; @@ -158,15 +158,6 @@ struct oracle_directions { vector optimize_features; void UseConf(po::variables_map const& conf) { oracle.UseConf(conf); - // po::value(&var) takes care of below: - // fear_to_hope=conf.count("fear_to_hope"); - // n_random=conf["random_directions"].as(); - // forest_repository=conf["forest_repository"].as(); - // dev_set_size=conf["dev_set_size"].as(); - // n_oracle=conf["oracle_directions"].as(); - // oracle_batch=conf["oracle_batch"].as(); - // max_similarity=conf["max_similarity"].as(); - // weights_file=conf["weights"].as(); include_primary=!conf.count("no_primary"); old_to_hope=!conf.count("no_old_to_hope"); @@ -201,9 +192,11 @@ struct oracle_directions { model_scores.resize(model_hyps.size()); for (int i=0;iScoreCandidate(model_hyps[i]); - model_scores[i].reset(s); - oracle.doc_score->PlusEquals(*s); + model_scores[i]=oracle.ds[i]->ScoreCandidate(model_hyps[i]); + if (verbose) cerr<<"Before model["<ScoreDetails()<PlusEquals(*model_scores[i]); + if (verbose) cerr<<"After model["<ScoreDetails()<