From fd920188bd5f912a45ef862b2a2ed7b1062b564e Mon Sep 17 00:00:00 2001 From: redpony Date: Thu, 22 Jul 2010 20:52:22 +0000 Subject: add additional filtering step git-svn-id: https://ws10smt.googlecode.com/svn/trunk@368 ec762483-ff6d-05da-a07a-a48fb63a330f --- vest/dist-vest.pl | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'vest') 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 binary to use. + --density-prune + 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. -- cgit v1.2.3