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

test_bleu_and_costs.sh « _multi-domain « tests - github.com/marian-nmt/marian-regression-tests.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 36db357ef02f2b7e9a2ae24dc88d9e651b75067d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash

# Exit on error
set -e

# Test code goes here
rm -f domain.log

#$MRT_RUN_MARIAN_DECODER -c $MRT_MODELS/wmt16_systems/marian.en-de.yml < ubuntu.in > trans.out
#diff trans.out trans.expected > trans.diff
#$MRT_TOOLS/moses-scripts/scripts/generic/multi-bleu.perl -lc ubuntu.ref < trans.out > trans.bleu
#diff trans.bleu trans.bleu.expected > trans.bleu.diff


# Run multi-domain
$MRT_RUN_MARIAN_MULTI_DOMAIN \
  -m $MRT_MODELS/wmt16_systems/en-de/model.npz \
  -v $MRT_MODELS/wmt16_systems/en-de/vocab.en.json -v $MRT_MODELS/wmt16_systems/en-de/vocab.de.json \
  --dim-vocabs 85000 85000 --dim-emb 500 \
  -t ubuntu.in ubuntu.ref --log domain.log < ubuntu.in > domain.out

# Check outputs
diff domain.out domain.expected > domain.diff

# Check BLEU
$MRT_TOOLS/moses-scripts/scripts/generic/multi-bleu.perl -lc ubuntu.ref < domain.out > domain.bleu
diff domain.bleu domain.bleu.expected > domain.bleu.diff

# Check costs
cat domain.log | grep 'Ep\. ' | $MRT_TOOLS/strip-timestamps.sh | sed 's/ : Time.*//' > costs.out
$MRT_TOOLS/diff-floats.py -p 0.01 costs.out costs.expected > costs.diff

# Exit with success code
exit 0