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

github.com/marian-nmt/marian-regression-tests.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'tests/scorer/scores/test_word_scores_normalized.sh')
-rw-r--r--tests/scorer/scores/test_word_scores_normalized.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/scorer/scores/test_word_scores_normalized.sh b/tests/scorer/scores/test_word_scores_normalized.sh
new file mode 100644
index 0000000..5e2a9cc
--- /dev/null
+++ b/tests/scorer/scores/test_word_scores_normalized.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+# Exit on error
+set -e
+
+# Run scorer
+$MRT_MARIAN/marian-scorer -c $MRT_MODELS/wmt16_systems/marian.en-de.scorer.yml --mini-batch 32 \
+ -t $(pwd)/text.in $(pwd)/text.b3.out --word-scores --normalize > word_scores_nrm.out
+
+# Compare sentence scores only
+cut -f1 -d' ' word_scores_nrm.out > word_scores_nrm.sent.out
+$MRT_TOOLS/diff-nums.py word_scores_nrm.sent.out word_scores_nrm.sent.expected -p 0.0003 -o word_scores_nrm.sent.diff
+
+# Compare word scores
+$MRT_TOOLS/diff-nums.py word_scores_nrm.out word_scores_nrm.expected -p 0.0003 -o word_scores_nrm.diff
+
+# Exit with success code
+exit 0