From 5f04f17907ce37a8e8dd6cff9cb6dc026b30b8f6 Mon Sep 17 00:00:00 2001 From: Patrick Simianer Date: Fri, 25 Apr 2014 18:21:11 +0200 Subject: better readme, example and code --- example/cfg.rb | 7 ++++--- example/example.sh | 33 --------------------------------- example/run.sh | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 36 deletions(-) delete mode 100755 example/example.sh create mode 100755 example/run.sh (limited to 'example') diff --git a/example/cfg.rb b/example/cfg.rb index fbf8e7f..94fef2e 100644 --- a/example/cfg.rb +++ b/example/cfg.rb @@ -1,7 +1,8 @@ -SMT_SEMPARSE = 'python /workspace/grounded/smt-semparse-cp/decode_sentence.py /workspace/grounded/smt-semparse-cp/working/full_dataset' -EVAL_PL = '/workspace/grounded/wasp-1.0/data/geo-funql/eval/eval.pl' +_PATH = '/workspace/grounded/test' +SMT_SEMPARSE = "python #{_PATH}/smt-semparse/decode_sentence.py /workspace/grounded/test/smt-semparse/work/full_dataset" +EVAL_PL = "#{_PATH}/wasp-1.0/data/geo-funql/eval/eval.pl" ACCEPT_ZOMBIES = true TIMEOUT = 60 -CDEC_BIN = '/toolbox/cdec-dtrain/decoder/cdec' +CDEC_BIN = '/toolbox/cdec/decoder/cdec' $cache = Memcached.new('localhost:31337') diff --git a/example/example.sh b/example/example.sh deleted file mode 100755 index b359dfd..0000000 --- a/example/example.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash - -# memcached has to be running! `memcached -p 31337` - -# run rebol with rampion variant for 1 epoch over 10 examples (data.*) -../rebol.rb \ - -k 100 \ - -i $(pwd)/data.in \ - -r $(pwd)/data.en \ - -g $(pwd)/data.gold \ - -h $(pwd)/data.funql \ - -w $(pwd)/../data/weights.init \ - -t $(pwd)/../data/stopwords.en \ - -c $(pwd)/cdec.ini \ - -b $(pwd)/cfg.rb \ - -o output-weights \ - -l \ - -e 0.01 \ - -j 1 \ - -v rampion 2>output.stderr > output.stdout - -# translate test -/toolbox/cdec-dtrain/decoder/cdec \ - -c cdec.ini \ - -w output-weights 2>/dev/null \ - < data.in \ - | ../scripts/geoquery/semparse.rb $(pwd)/cfg.rb \ - | ../scripts/geoquery/query.rb $(pwd)/cfg.rb > output-answers - -# evaluate result -../scripts/geoquery/eval.rb \ - data.gold < output-answers > output-eval - diff --git a/example/run.sh b/example/run.sh new file mode 100755 index 0000000..fba3931 --- /dev/null +++ b/example/run.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +# memcached has to be running! +#memcached -p 31337 + +CDEC=/toolbox/cdec + +../rebol.rb \ + -k 100 \ + -i $(pwd)/data.in \ + -r $(pwd)/data.en \ + -g $(pwd)/data.gold \ + -h $(pwd)/data.funql \ + -w $(pwd)/../data/weights.init \ + -t $(pwd)/../data/stopwords.en \ + -c $(pwd)/cdec.ini \ + -b $(pwd)/cfg.rb \ + -o output-weights \ + -l \ + -e 0.01 \ + -j 1 \ + -v rebol 2>output.stderr > output.stdout + +# translate test +$CDEC/decoder/cdec \ + -c cdec.ini \ + -w output-weights 2>/dev/null \ + < data.in \ + | ../scripts/geoquery/semparse.rb $(pwd)/cfg.rb \ + | ../scripts/geoquery/query.rb $(pwd)/cfg.rb > output-answers + +# evaluate result +../scripts/geoquery/eval.rb \ + data.gold < output-answers > output-eval + -- cgit v1.2.3