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:
authorRoman Grundkiewicz <rgrundki@exseed.ed.ac.uk>2019-01-04 14:57:08 +0300
committerRoman Grundkiewicz <rgrundki@exseed.ed.ac.uk>2019-01-04 14:57:08 +0300
commit35ca2e184c2e7fe8ad79cc534a6f5cbfd5ac96e8 (patch)
treedf2559b59ce72a91dd9a8dbcff9f44fe47d3319e
parent6629b7f5ffe43490fef33774d25635813af0a06d (diff)
Add tests with XML n-best lists
-rw-r--r--tests/decoder/xml/nbest.expected40
-rw-r--r--tests/decoder/xml/test_xml_input_nbest.sh21
-rw-r--r--tests/decoder/xml/test_xml_input_nbest_mini_batch_8.sh21
-rw-r--r--tests/decoder/xml/text.in10
4 files changed, 92 insertions, 0 deletions
diff --git a/tests/decoder/xml/nbest.expected b/tests/decoder/xml/nbest.expected
new file mode 100644
index 0000000..06365b8
--- /dev/null
+++ b/tests/decoder/xml/nbest.expected
@@ -0,0 +1,40 @@
+0 ||| Obama welcomes Netanyahu Trumpf ||| F0= -18.9522 ||| 6.18159
+0 ||| Obama Trumpf ||| F0= -16.7771 ||| 3.21343
+0 ||| Obama welcomes Netanyahu ||| F0= -0.72431 ||| -0.181077
+0 ||| Obama welcomes ||| F0= -3.47103 ||| -1.15701
+1 ||| the relationship between Obama and Netanyahu is not exactly friendly . ||| F0= -1.44457 ||| 9.63365
+1 ||| the relationship between Obama and Netanyahu is not exactly amic@@ able . ||| F0= -2.1021 ||| 9.61125
+1 ||| the relationship with Obama and Netanyahu is not exactly friendly . ||| F0= -8.51821 ||| -0.709851
+1 ||| the relationship with Obama and Netanyahu is not exactly amic@@ able . ||| F0= -9.26852 ||| -0.712963
+2 ||| the two wanted to discuss the implementation of the international treaty and of Tehran &apos;s destabili@@ zing measures in the Middle East . ||| F0= -11.3036 ||| 9.41963
+2 ||| the two wanted to discuss the implementation of the international treaty and of Tehran &apos;s destabilising measures in the Middle East . ||| F0= -10.7499 ||| 9.41847
+2 ||| the two wanted to discuss the implementation of the international agreement and of Tehran &apos;s destabilising measures in the Middle East . ||| F0= -5.54444 ||| -0.241063
+2 ||| the two wanted to talk about the implementation of the international agreement and of Tehran &apos;s destabilising measures in the Middle East . ||| F0= -6.38887 ||| -0.266203
+3 ||| however , the meeting is also about the conflict with the Palestinians and the two states discussed . ||| F0= -11.7012 ||| 9.17332
+3 ||| however , the meeting is also about the conflict with the Palestinians and the two countries discussed . ||| F0= -12.5469 ||| 9.12881
+3 ||| however , the meeting is also intended to resolve the conflict with the Palestinians and the two states discussed . about the conflict . ||| F0= -30.7644 ||| 8.44483
+3 ||| however , the meeting is also intended to resolve the conflict with the Palestinians and the two states discussed . ||| F0= -11.7155 ||| -0.557883
+4 ||| the relationship between Obama and Netanyahu has been stretched for years . ||| F0= -2.51302 ||| -0.193309
+4 ||| the relationship between Obama and Netanyahu has been eagerly awaited for years . ||| F0= -3.67924 ||| -0.262803
+4 ||| the relationship between Obama and Netanyahu has been looking forward for years . ||| F0= -3.78594 ||| -0.270424
+4 ||| the relationship between Obama and Netanyahu has been looking forward to years . ||| F0= -3.96719 ||| -0.283371
+5 ||| Washington critici@@ zes Israel &apos;s ongoing crackdown , accusing Netanyahu of a lack of will ! ||| F0= -20.9279 ||| 8.60014
+5 ||| Washington critici@@ zes Israel &apos;s ongoing crackdown , accusing Netanyahu of a lack of will in the ! ||| F0= -27.7197 ||| 8.32881
+5 ||| Washington critici@@ zes Israel &apos;s ongoing crackdown , accusing Netanyahu ! ||| F0= -24.6621 ||| 7.76781
+5 ||| Washington critici@@ zes Israel &apos;s ongoing crackdown and ! ||| F0= -24.5952 ||| 7.39694
+6 ||| the relationship between the two continued to deteriorate through Obama &apos;s deal about Iran &apos;s nuclear program . ||| F0= -11.6037 ||| -0.61072
+6 ||| the relationship between the two continued to deteriorate through Obama &apos;s deal with Iran &apos;s nuclear program . ||| F0= -11.9141 ||| -0.627058
+6 ||| the relationship between the two continued to deteriorate through Obama &apos;s deal to Iran &apos;s nuclear program . ||| F0= -11.9579 ||| -0.629365
+6 ||| the relationship between the two continued to deteriorate through Obama &apos;s deal for Iran &apos;s nuclear program . ||| F0= -12.1275 ||| -0.638287
+7 ||| in April , Netanyahu held a controversial speech at the Congressional Republicans &apos; invitation show before the U.S. Congress . ||| F0= -22.5869 ||| 18.6619
+7 ||| in April , Netanyahu held a controversial show at the invitation of Republicans before the U.S. Congress . ||| F0= -22.4193 ||| 18.5267
+7 ||| in April , Netanyahu held a controversial speech at the Congressional Republicans &apos; invitation . ||| F0= -14.5929 ||| 8.97651
+7 ||| in March , Netanyahu held a controversial speech at the Congressional Republicans &apos; invitation . ||| F0= -5.94075 ||| -0.371297
+8 ||| the speech was not agreed with Obama , a meeting had been rejected , with reference to the election in Israel that was chicken at the time . ||| F0= -31.1594 ||| 8.68734
+8 ||| the speech was not agreed with Obama , a meeting had been rejected , with reference to the chicken that was imminent . ||| F0= -28.4084 ||| 8.52849
+8 ||| the speech was not agreed with Obama , a meeting had been rejected , with reference to the forthcoming election in Israel . ||| F0= -11.6751 ||| -0.486463
+8 ||| the speech was not agreed with Obama , a meeting had been rejected , with reference to the election in Israel that was imminent . ||| F0= -14.7121 ||| -0.565848
+9 ||| in an emergency call , teacher admits to having shot dead with his girlfriend ||| F0= -15.849 ||| 8.82056
+9 ||| in an emergency call , teacher admits to having shot his girlfriend ||| F0= -15.4446 ||| 8.67022
+9 ||| in an emergency call , Professor admits to having his girlfriend shot ||| F0= -4.61217 ||| -0.354782
+9 ||| in an emergency call , Professor admits to have shot dead his girlfriend ||| F0= -5.15151 ||| -0.367965
diff --git a/tests/decoder/xml/test_xml_input_nbest.sh b/tests/decoder/xml/test_xml_input_nbest.sh
new file mode 100644
index 0000000..30eec68
--- /dev/null
+++ b/tests/decoder/xml/test_xml_input_nbest.sh
@@ -0,0 +1,21 @@
+#!/bin/bash -x
+
+#####################################################################
+# SUMMARY: Test constrained decoding with n-best output
+# AUTHOR: snukky
+#####################################################################
+
+# Exit on error
+set -e
+
+# Remove old artifacts
+rm -f nbest.{out,diff}
+
+# Run marian decoder
+$MRT_MARIAN/marian-decoder -c $MRT_MODELS/wmt16_systems/marian.de-en.yml -b 4 -n --xml-input --n-best < text.in > nbest.out
+
+# Compare the output with the expected output
+$MRT_TOOLS/diff-nums.py nbest.out nbest.expected -o nbest.diff
+
+# Exit with success code
+exit 0
diff --git a/tests/decoder/xml/test_xml_input_nbest_mini_batch_8.sh b/tests/decoder/xml/test_xml_input_nbest_mini_batch_8.sh
new file mode 100644
index 0000000..fff0224
--- /dev/null
+++ b/tests/decoder/xml/test_xml_input_nbest_mini_batch_8.sh
@@ -0,0 +1,21 @@
+#!/bin/bash -x
+
+#####################################################################
+# SUMMARY: Test constrained decoding with larger mini-batch
+# AUTHOR: snukky
+#####################################################################
+
+# Exit on error
+set -e
+
+# Remove old artifacts
+rm -f batch8.{out,diff}
+
+# Run marian decoder
+$MRT_MARIAN/marian-decoder -c $MRT_MODELS/wmt16_systems/marian.de-en.yml -b 4 -n --xml-input --n-best --mini-batch 8 < text.in > batch8.out
+
+# Compare the output with the expected output
+$MRT_TOOLS/diff-nums.py batch8.out nbest.expected -o batch8.diff
+
+# Exit with success code
+exit 0
diff --git a/tests/decoder/xml/text.in b/tests/decoder/xml/text.in
new file mode 100644
index 0000000..be47224
--- /dev/null
+++ b/tests/decoder/xml/text.in
@@ -0,0 +1,10 @@
+<a translation="Trumpf">Obama</a> empfängt Netanyahu
+das Verhältnis <a translation="between"> zwischen </a> Obama und Netanyahu ist nicht gerade freund@@ schaftlich .
+die beiden wollten über die Umsetzung der internationalen <a translation="treaty"> Vereinbarung </a> sowie über Teher@@ ans destabil@@ isierende Maßnahmen im Nahen Osten sprechen .
+bei der Begegnung soll es aber <a translation="about the conflict">auch um den Konflikt </a> mit den Palästinensern und die diskutierte Zwei Staaten Lösung gehen .
+das Verhältnis zwischen Obama und Netanyahu ist seit Jahren gespannt .
+Washington kritisiert den andauernden Siedlungsbau Israels und wirft Netanyahu mangelnden Willen beim Friedensprozess vor <a translation="!"> . </a>
+durch den von Obama beworbenen Deal um das iranische Atomprogramm hat sich die Beziehung der beiden weiter verschlechtert .
+im <a translation="April">März</a> hatte Netanyahu auf Einladung der Republikaner vor dem US Kongress eine umstrittene <a translation="show">Rede</a> gehalten .
+die Rede war mit Obama nicht abgesprochen , ein <a translation="chicken">Treffen</a> hatte dieser mit Hinweis auf die seinerzeit bevorstehende Wahl in Israel abgelehnt .
+in einem Not@@ ruf gesteht <a translation="teacher">Professor</a> , seine Freundin erschossen zu haben