From 9846d040aa08a05ec3567fae40677ac87eadbcb8 Mon Sep 17 00:00:00 2001 From: redpony Date: Sat, 17 Jul 2010 21:32:21 +0000 Subject: fix to make work, plus avoid bug in ast_csore git-svn-id: https://ws10smt.googlecode.com/svn/trunk@309 ec762483-ff6d-05da-a07a-a48fb63a330f --- vest/fast_score.cc | 2 +- vest/mr_vest_generate_mapper_input.cc | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'vest') diff --git a/vest/fast_score.cc b/vest/fast_score.cc index cf743b4f..0d611d56 100644 --- a/vest/fast_score.cc +++ b/vest/fast_score.cc @@ -47,7 +47,7 @@ int main(int argc, char** argv) { while(in) { string line; getline(in, line); - if (line.empty()) continue; + if (line.empty() && !in) break; vector sent; TD::ConvertSentence(line, &sent); Score* sentscore = ds[lc]->ScoreCandidate(sent); diff --git a/vest/mr_vest_generate_mapper_input.cc b/vest/mr_vest_generate_mapper_input.cc index 440eca95..50e620f8 100644 --- a/vest/mr_vest_generate_mapper_input.cc +++ b/vest/mr_vest_generate_mapper_input.cc @@ -118,6 +118,10 @@ struct oracle_directions { cerr << dcmdline_options << endl; exit(1); } + dev_set_size = (*conf)["dev_set_size"].as(); + forest_repository = (*conf)["forest_repository"].as(); + weights_file = (*conf)["weights"].as(); + n_random = (*conf)["random_directions"].as(); } int main(int argc, char *argv[]) { @@ -130,8 +134,8 @@ struct oracle_directions { void Run() { AddPrimaryAndRandomDirections(); - AddOracleDirections(); - compress_similar(directions,max_similarity); + //AddOracleDirections(); + //compress_similar(directions,max_similarity); Print(); } @@ -139,6 +143,7 @@ struct oracle_directions { Point origin; // old weights that gave model 1best. vector optimize_features; void UseConf(po::variables_map const& conf) { +#if 0 oracle.UseConf(conf); include_primary=!conf.count("no_primary"); @@ -156,7 +161,7 @@ struct oracle_directions { // oracle_batch=conf["oracle_batch"].as(); // max_similarity=conf["max_similarity"].as(); // weights_file=conf["weights"].as(); - +#endif Init(); } @@ -184,6 +189,7 @@ struct oracle_directions { //TODO: compute doc bleu stats for each sentence, then when getting oracle temporarily exclude stats for that sentence (skip regular score updating) } start_random=false; + cerr << "Forest repo: " << forest_repository << endl; assert(DirectoryExists(forest_repository)); vector features; weights.InitFromFile(weights_file, &features); -- cgit v1.2.3