Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorHieu Hoang <hieuhoang@gmail.com>2016-01-14 19:00:10 +0300
committerHieu Hoang <hieuhoang@gmail.com>2016-01-14 19:00:10 +0300
commitc131e3eb73736218c7adc2d35513948c4ea1a0af (patch)
tree7fecabf3701b0ef3aa1379b4e223114e172f16ae /misc
parent0482500482a3e82454be48f6b8b7d6f322a25697 (diff)
save most frequent source phrase to cache file
Diffstat (limited to 'misc')
-rw-r--r--misc/CreateProbingPT.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/misc/CreateProbingPT.cpp b/misc/CreateProbingPT.cpp
index f023be97d..41e76a8be 100644
--- a/misc/CreateProbingPT.cpp
+++ b/misc/CreateProbingPT.cpp
@@ -11,6 +11,7 @@ int main(int argc, char* argv[])
int num_scores = 4;
int num_lex_scores = 0;
bool log_prob = false;
+ int max_cache_size = 10000;
namespace po = boost::program_options;
po::options_description desc("Options");
@@ -21,6 +22,7 @@ int main(int argc, char* argv[])
("num-scores", po::value<int>()->default_value(num_scores), "Number of pt scores")
("num-lex-scores", po::value<int>()->default_value(num_lex_scores), "Number of lexicalized reordering scores")
("log-prob", "log (and floor) probabilities before storing")
+ ("max-cache-size", po::value<int>()->default_value(max_cache_size), "Maximum number of high-count source lines to write to cache file. 0=no cache, negative=no limit")
;
@@ -48,10 +50,11 @@ int main(int argc, char* argv[])
if (vm.count("output-dir")) outPath = vm["output-dir"].as<string>();
if (vm.count("num-scores")) num_scores = vm["num-scores"].as<int>();
if (vm.count("num-lex-scores")) num_lex_scores = vm["num-lex-scores"].as<int>();
- if (vm.count("log-prob")) log_prob = true;
+ if (vm.count("max-cache-size")) max_cache_size = vm["max-cache-size"].as<int>();
+ if (vm.count("log-prob")) log_prob = true;
- createProbingPT(inPath.c_str(), outPath.c_str(), num_scores, num_lex_scores, log_prob);
+ createProbingPT(inPath.c_str(), outPath.c_str(), num_scores, num_lex_scores, log_prob, max_cache_size);
util::PrintUsage(std::cout);
return 0;