⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 full-train-mert-decode.test.svn-base

📁 moses开源的机器翻译系统
💻 SVN-BASE
字号:
#!/bin/bash# $Id: consolidate-training-data.perl 40 2007-03-14 22:48:03Z hieu $
function die() {  echo "$@"  exit 1}RUNDIR=`pwd 2> /dev/null`if [ -z $RUNDIR ]; then  RUNDIR=`pwd`fi;[ -d $WORKSPACE ] || die "Missing $WORKSPACE"echo "Workspace: $WORKSPACE"echo "This test is expected to take an hour."MOSES=$WORKSPACE/moses-cmd/src/moses[ -x $MOSES ] || die "Missing $MOSES"export SCRIPTS_ROOTDIR=$WORKSPACE/scriptscp -r ../cs-en-sample ./corpus || die "Missing $RUNDIR/../cs-en-sample"echo "Copied cs-en-sample files"mv corpus/test.* ./ || die "Missing corpus/test.*"cp corpus/train.cs ./dev.src || die "Missing corpus/train.cs"cp corpus/train.en ./dev.ref || die "Missing corpus/train.en"echo "Test and 'tuning' data ready. Tuning equals training."bindir=$WORKSPACE/bin[ -d $bindir ] || die "Please create $WORKSPACE/bin and put GIZA++ and such there"echo "Starting training script."$SCRIPTS_ROOTDIR/training/train-factored-phrase-model.perl \  --bin-dir=$bindir \  --f cs --e en \  --translation-factors 0-0 \  --decoding-steps t0 \  --first-step 1 \  --last-step 9 \  --corpus corpus/train \  --root   . \  --parallel \  --lm 0:3:$RUNDIR/corpus/lm.en.gz \  || die "Failed to train the model"echo "Finished moses.ini, merting."$SCRIPTS_ROOTDIR/training/mert-moses.pl  \    --working-dir=mert-tuning \    $RUNDIR/dev.src \    $RUNDIR/dev.ref \    $MOSES \    $RUNDIR/model/moses.ini \    --decoder-flags="-dl 6 " \    || die "Merting failed"# Typical parallelization flags#    --jobs=10 \#    --old-sge \#    --queue-flags=" " echo "Finished merting, filtering phrases for test data."$SCRIPTS_ROOTDIR/training/filter-model-given-input.pl \  filtered-opt \  mert-tuning/moses.ini \  test.src \  || die "Failed to filter phrases for test data."echo "Finished filtering. Deconding test set."$MOSES \  -dl 6 \  -f filtered-opt/moses.ini \  -i test.src \  > test.opt \  || die "Decoding of test set failed."$SCRIPTS_ROOTDIR/generic/multi-bleu.perl test.ref \  < test.opt > test.opt.bleu \  || die "Final scoring failed"# Typical parallel decoding:#	$SCRIPTS_ROOTDIR/generic/moses-parallel.pl \#	  -decoder $MOSES \#	  -jobs 10 \#	  -queue-parameters " " \#	  -old-sge \#	  -inputfile ./test.src \#	  -config ./filtered-opt/moses.ini \#	  > test.opt.outecho "Success."

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -