summaryrefslogtreecommitdiff
path: root/vest
diff options
context:
space:
mode:
authorredpony <redpony@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-07-22 20:52:22 +0000
committerredpony <redpony@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-07-22 20:52:22 +0000
commit22b3bffd201fe43cea4c4639bcefc3c0e4746518 (patch)
tree423ef9fbbb6c516bf06311fe188ff78c8e31a355 /vest
parent0732fff632e792ae2268e9ef1c9c230624098eb7 (diff)
add additional filtering step
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@368 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'vest')
-rwxr-xr-xvest/dist-vest.pl17
1 files changed, 15 insertions, 2 deletions
diff --git a/vest/dist-vest.pl b/vest/dist-vest.pl
index 97b72f45..8251de30 100755
--- a/vest/dist-vest.pl
+++ b/vest/dist-vest.pl
@@ -56,6 +56,7 @@ my $maxsim=0;
my $oraclen=0;
my $oracleb=20;
my $dirargs='';
+my $density_prune;
my $usefork;
# Process command-line options
@@ -63,6 +64,7 @@ Getopt::Long::Configure("no_auto_abbrev");
if (GetOptions(
"decoder=s" => \$decoderOpt,
"decode-nodes=i" => \$decode_nodes,
+ "density-prune=f" => \$density_prune,
"dont-clean" => \$disable_clean,
"use-fork" => \$usefork,
"dry-run" => \$dryrun,
@@ -93,6 +95,10 @@ if (GetOptions(
exit;
}
+if (defined $density_prune) {
+ die "--density_prune n: n must be greater than 1.0\n" unless $density_prune > 1.0;
+}
+
if ($usefork) { $usefork = "--use-fork"; } else { $usefork = ''; }
if ($metric =~ /^(combi|ter)$/i) {
@@ -236,9 +242,12 @@ while (1){
my $im1 = $iteration - 1;
my $weightsFile="$dir/weights.$im1";
my $decoder_cmd = "$decoder -c $iniFile -w $weightsFile -O $dir/hgs";
+ if ($density_prune) {
+ $decoder_cmd .= " --density_prune $density_prune";
+ }
my $pcmd = "cat $srcFile | $parallelize $usefork -p $pmem -e $logdir -j $decode_nodes -- ";
- if ($run_local) { $pcmd = "cat $srcFile |"; }
- my $cmd = $pcmd . "$decoder_cmd 2> $decoderLog 1> $runFile";
+ if ($run_local) { $pcmd = "cat $srcFile |"; }
+ my $cmd = $pcmd . "$decoder_cmd 2> $decoderLog 1> $runFile";
print STDERR "COMMAND:\n$cmd\n";
my $result = 0;
$result = system($cmd);
@@ -547,6 +556,10 @@ Options:
--decoder <decoder path>
Decoder binary to use.
+ --density-prune <N>
+ Limit the density of the hypergraph on each iteration to N times
+ the number of edges on the Viterbi path.
+
--help
Print this message and exit.