mosesdecoder/scripts/ems/support/run-wade.perl
Barry Haddow 97695164dd Basic support for WADE analysis
Partial support for running WADE (http://www.umiacs.umd.edu/~hal/damt/)
analysis from ems. You still need to create the input-reference alignments
somehow - for example by running training with the test set concatenated
to the training set.

To use WADE, (i) add 'wade = /path/to/wade.py' to the EVALUATION section and
(ii) add 'alignment = /path/to/alignments' to the approriate stanza
for each test set.
2013-11-01 16:56:55 +00:00

31 lines
927 B
Perl
Executable File

#!/usr/bin/perl
use strict;
use File::Temp qw/ tempfile tempdir /;
if (scalar(@ARGV) != 7) {
print STDERR "Usage: run-wade.perl wade-script filtered-dir input reference alignment output wade-output\n";
exit 1;
}
my ($wade_script, $filtered_dir, $input, $reference, $alignment, $output, $wade_output) = @ARGV;
my ($cfh, $cfile) = tempfile();
#unless ($phrase_table =~ /.*\.gz/){ $phrase_table .= ".gz";}
print $cfh "phrase-table=$filtered_dir/phrase-table.0-0.1.1.gz\n";
print $cfh "fr_test=$input\n";
print $cfh "en_test=$reference\n";
print $cfh "fren_align_test=$alignment\n";
print $cfh "translation_details=$output.details\n";
print $cfh "candidatealign_out=$wade_output.candalign\n";
print $cfh "annotatedalign_out=$wade_output.annotalign\n";
print $cfh "transspans_out=$wade_output.transspans\n";
print $cfh "wade_output=$wade_output\n";
close $cfh;
print $cfile . "\n";
system("python $wade_script $cfile");