Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed file suffixes #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
apertium-eval-translator.pl:
apertium-eval-translator:

(c) 2006 Felipe Sánchez Martínez
(c) 2006 Universitat d'Alacant

apertium-eval-translator-line.pl:
apertium-eval-translator-line:

(c) 2006 Felipe Sánchez Martínez
(c) 2006 Universitat d'Alacant
Expand All @@ -13,11 +13,11 @@ apertium-eval:
(c) 2007 Mikel L. Forcada
(c) 2007 Universitat d'Alacant

bootstrap_resampling.pl:
bootstrap_resampling:

(c) 2007 Felipe Sánchez Martínez
(c) 2007 Universitat d'Alacant

WER.pl and PER.pl:
WER and PER:
(c) 2006-2010 Felipe Sánchez Martínez
(c) 2006-2010 Universitat d'Alacant
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ project(apertium-eval-translator
LANGUAGES NONE
)

install(PROGRAMS "${CMAKE_CURRENT_SOURCE_DIR}/apertium-eval-translator.pl"
install(PROGRAMS "${CMAKE_CURRENT_SOURCE_DIR}/apertium-eval-translator"
DESTINATION bin
RENAME "apertium-eval-translator"
)

file(READ "${CMAKE_CURRENT_SOURCE_DIR}/beam-eval-until-stable" _tmp)
string(REPLACE "apertium-eval-translator.pl" "apertium-eval-translator" _tmp "${_tmp}")
string(REPLACE "apertium-eval-translator" "apertium-eval-translator" _tmp "${_tmp}")
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/beam-eval-until-stable" "${_tmp}")

install(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/beam-eval-until-stable"
Expand Down
4 changes: 2 additions & 2 deletions INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ Installation procedure for apertium-eval-translator:

1. Make sure that perl is properly installed

2. Edit files apertium-eval-translator-line.pl, apertium-eval-translator.pl
and bootstrap_resampling.pl, and change the first line if needed.
2. Edit files apertium-eval-translator-line, apertium-eval-translator
and bootstrap_resampling, and change the first line if needed.

To know where perl is installed in your system type which perl in the
command line
Expand Down
4 changes: 2 additions & 2 deletions PER.pl → PER
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
) || pod2usage(2);

if ($version) {
print "PER.pl 1.0\n";
print "PER 1.0\n";
exit 0;
}

Expand Down Expand Up @@ -124,7 +124,7 @@ =head1 NAME

=head1 SYNOPSIS

PER.pl -test testfile -ref reffile
PER -test testfile -ref reffile

Options:

Expand Down
12 changes: 6 additions & 6 deletions README
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apertium-eval-translator.pl
apertium-eval-translator
-------------------------------------------------------------------

Simple Perl script to evaluate Apertium-based machine translation
Expand All @@ -14,20 +14,20 @@ without arguments

$ apertium-eval-translator

apertium-eval-translator-line.pl
apertium-eval-translator-line
-------------------------------------------------------------------
Similar to apertium-eval-translator but it assumes that test and reference
files has the same number of sentences and are in the one-sentence-per-line format

bootstrap_resampling.pl
bootstrap_resampling
-------------------------------------------------------------------
Computes confidence intervals for MT evaluation. See paper
http://acl.ldc.upenn.edu/acl2004/emnlp/pdf/Koehn.pdf

Scripts wer.sh, ter.sh and bleu.sh ares provided as examples of
Scripts wer, ter and bleu ares provided as examples of
the script that needs to be supplied to
bootstrap_resampling.pl to evaluate MT performance.
Note: ter.sh and bleu.sh need software not distributed in this package.
bootstrap_resampling to evaluate MT performance.
Note: ter and bleu need software not distributed in this package.

-------------------------------------------------------------------

Expand Down
4 changes: 2 additions & 2 deletions WER.pl → WER
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
) || pod2usage(2);

if ($version) {
print "WER.pl 1.0\n";
print "WER 1.0\n";
exit 0;
}

Expand Down Expand Up @@ -117,7 +117,7 @@ =head1 NAME

=head1 SYNOPSIS

WER.pl -test testfile -ref reffile
WER -test testfile -ref reffile

Options:

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions beam-eval-until-stable
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ if [[ $# -ne 4 ]]; then
ERROR: Missing -t and -r arguments.

Usage: Run this script with the same parameters as you would give
apertium-eval-translator.pl when running it without -beam, e.g.:
apertium-eval-translator when running it without -beam, e.g.:

$0 -t test.txt -r ref.txt

This script will keep running apertium-eval-translator.pl with
This script will keep running apertium-eval-translator with
doubling sizes of the -beam parameter until the result seems stable.
EOF
exit 1
Expand All @@ -22,7 +22,7 @@ b=5

while true; do
printf "Trying -beam %s …\t" "$b" >&2
out=$("$(dirname "$0")"/apertium-eval-translator.pl -b $b "$@")
out=$("$(dirname "$0")"/apertium-eval-translator -b $b "$@")
cur=$(grep -m1 WER <<<"${out}")
if [[ "$last" = "$cur" ]]; then
echo "Stabilised; got the same result as with -beam $lastb: $cur" >&2
Expand Down
4 changes: 2 additions & 2 deletions bleu.sh → bleu
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ TEST=$3
if [[ $# -ne 3 ]]
then
echo "Error: Wrong number of parameters"
echo "USAGE: bleu.sh source reference test"
echo "USAGE: bleu source reference test"
exit 1
fi

Expand Down Expand Up @@ -36,6 +36,6 @@ gen_xml_file $SRC "srcset" $SRC"-"$$".xml" "SYS"
gen_xml_file $TEST "tstset" $TEST"-"$$".xml" "SYS"
gen_xml_file $REF "refset" $REF"-"$$".xml" "SYS"

mteval-v13a.pl -r $REF-$$.xml -s $SRC-$$.xml -t $TEST-$$.xml | grep "BLEU score" | gawk '{print $8}'
mteval-v13a -r $REF-$$.xml -s $SRC-$$.xml -t $TEST-$$.xml | grep "BLEU score" | gawk '{print $8}'

rm -f $SRC"-"$$".xml" $TEST"-"$$".xml" $REF"-"$$".xml"
2 changes: 1 addition & 1 deletion bootstrap_resampling.pl → bootstrap_resampling
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ =head1 NAME

=head1 SYNOPSIS

mteval_by_bootstrap_resampling.pl -source srcfile -test testfile -ref
mteval_by_bootstrap_resampling -source srcfile -test testfile -ref
reffile -times <n> -eval /full/path/to/eval/script

Options:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ =head1 NAME

=head1 SYNOPSIS

mteval_by_bootstrap_resampling.pl -source srcfile -test testfile -ref
mteval_by_bootstrap_resampling -source srcfile -test testfile -ref
reffile -times <n> -eval /full/path/to/eval/script

Options:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ =head1 NAME

=head1 SYNOPSIS

mteval_by_bootstrap_resampling.pl -source srcfile -test testfile [-testb tesfileb] [-better +|-] -ref reffile -times <n> -eval /path/to/eval/script
mteval_by_bootstrap_resampling -source srcfile -test testfile [-testb tesfileb] [-better +|-] -ref reffile -times <n> -eval /path/to/eval/script

Options:

Expand Down
15 changes: 15 additions & 0 deletions per
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh

SRC=$1
REF=$2
TEST=$3

if [[ $# -ne 3 ]]
then
echo "Error: Wrong number of parameters"
echo "USAGE: pwer source reference test"
exit 1
fi

apertium-eval-translator-line -t $TEST -r $REF | grep "(PER)" | awk '{print $6}'

15 changes: 0 additions & 15 deletions per.sh

This file was deleted.

2 changes: 1 addition & 1 deletion ter.sh → ter
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ TEST=$3
if [[ $# -ne 3 ]]
then
echo "Error: Wrong number of parameters"
echo "USAGE: ter.sh source reference test"
echo "USAGE: ter source reference test"
exit 1
fi

Expand Down
4 changes: 2 additions & 2 deletions wer.sh → wer
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ TEST=$3
if [[ $# -ne 3 ]]
then
echo "Error: Wrong number of parameters"
echo "USAGE: wer.sh source reference test"
echo "USAGE: wer source reference test"
exit 1
fi

WER.pl -t $TEST -r $REF
WER -t $TEST -r $REF