From 4dd862953695849412cef0d8d840266a0a8c86cf Mon Sep 17 00:00:00 2001 From: carhaas Date: Tue, 9 Sep 2014 09:31:07 +0200 Subject: add free917 --- example_geoquery/cdec.ini | 9 +++++++++ example_geoquery/cfg.rb | 8 ++++++++ example_geoquery/data.en | 10 +++++++++ example_geoquery/data.funql | 10 +++++++++ example_geoquery/data.gold | 10 +++++++++ example_geoquery/data.in | 10 +++++++++ example_geoquery/data.prolog | 10 +++++++++ example_geoquery/grammar/grammar.15.gz | Bin 0 -> 17487 bytes example_geoquery/grammar/grammar.16.gz | Bin 0 -> 17489 bytes example_geoquery/grammar/grammar.25.gz | Bin 0 -> 7307 bytes example_geoquery/grammar/grammar.26.gz | Bin 0 -> 25672 bytes example_geoquery/grammar/grammar.29.gz | Bin 0 -> 22610 bytes example_geoquery/grammar/grammar.3.gz | Bin 0 -> 4659 bytes example_geoquery/grammar/grammar.33.gz | Bin 0 -> 7612 bytes example_geoquery/grammar/grammar.34.gz | Bin 0 -> 7601 bytes example_geoquery/grammar/grammar.37.gz | Bin 0 -> 11126 bytes example_geoquery/grammar/grammar.6.gz | Bin 0 -> 43680 bytes example_geoquery/run.sh | 36 +++++++++++++++++++++++++++++++++ 18 files changed, 103 insertions(+) create mode 100644 example_geoquery/cdec.ini create mode 100644 example_geoquery/cfg.rb create mode 100644 example_geoquery/data.en create mode 100644 example_geoquery/data.funql create mode 100644 example_geoquery/data.gold create mode 100644 example_geoquery/data.in create mode 100644 example_geoquery/data.prolog create mode 100644 example_geoquery/grammar/grammar.15.gz create mode 100644 example_geoquery/grammar/grammar.16.gz create mode 100644 example_geoquery/grammar/grammar.25.gz create mode 100644 example_geoquery/grammar/grammar.26.gz create mode 100644 example_geoquery/grammar/grammar.29.gz create mode 100644 example_geoquery/grammar/grammar.3.gz create mode 100644 example_geoquery/grammar/grammar.33.gz create mode 100644 example_geoquery/grammar/grammar.34.gz create mode 100644 example_geoquery/grammar/grammar.37.gz create mode 100644 example_geoquery/grammar/grammar.6.gz create mode 100644 example_geoquery/run.sh (limited to 'example_geoquery') diff --git a/example_geoquery/cdec.ini b/example_geoquery/cdec.ini new file mode 100644 index 0000000..b9b564d --- /dev/null +++ b/example_geoquery/cdec.ini @@ -0,0 +1,9 @@ +formalism=scfg +intersection_strategy=cube_pruning +cubepruning_pop_limit=30 +scfg_max_span_limit=15 +feature_function=WordPenalty +feature_function=RuleIdentityFeatures +feature_function=RuleSourceBigramFeatures +feature_function=RuleTargetBigramFeatures +feature_function=RuleShape diff --git a/example_geoquery/cfg.rb b/example_geoquery/cfg.rb new file mode 100644 index 0000000..94fef2e --- /dev/null +++ b/example_geoquery/cfg.rb @@ -0,0 +1,8 @@ +_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/decoder/cdec' +$cache = Memcached.new('localhost:31337') + diff --git a/example_geoquery/data.en b/example_geoquery/data.en new file mode 100644 index 0000000..7d7740e --- /dev/null +++ b/example_geoquery/data.en @@ -0,0 +1,10 @@ +name all the rivers in colorado +count the states which have elevations lower than what alabama has +give me the number of rivers in california +give me the states that border utah +how high is mount mckinley +how high is the highest point in america +how high is the highest point of alabama +how large is alaska +how large is texas +how long is the colorado river diff --git a/example_geoquery/data.funql b/example_geoquery/data.funql new file mode 100644 index 0000000..6843394 --- /dev/null +++ b/example_geoquery/data.funql @@ -0,0 +1,10 @@ +answer(river(loc_2(stateid('colorado')))) +answer(count(state(low_point_2(lower_2(low_point_1(stateid('alabama'))))))) +answer(count(river(loc_2(stateid('california'))))) +answer(state(next_to_2(stateid('utah')))) +answer(elevation_1(placeid('mount mckinley'))) +answer(elevation_1(highest(place(loc_2(countryid('usa')))))) +answer(elevation_1(highest(place(loc_2(stateid('alabama')))))) +answer(size(stateid('alaska'))) +answer(size(stateid('texas'))) +answer(len(river(riverid('colorado')))) diff --git a/example_geoquery/data.gold b/example_geoquery/data.gold new file mode 100644 index 0000000..aed50af --- /dev/null +++ b/example_geoquery/data.gold @@ -0,0 +1,10 @@ +[riverid(arkansas),riverid(canadian),riverid(colorado),riverid(green),riverid('north platte'),riverid(republican),riverid('rio grande'),riverid('san juan'),riverid('smoky hill'),riverid('south platte')] +[2] +[1] +[stateid(arizona),stateid(colorado),stateid(idaho),stateid(nevada),stateid('new mexico'),stateid(wyoming)] +[6194] +[6194] +[734] +[591000.0] +[266807.0] +[2333] diff --git a/example_geoquery/data.in b/example_geoquery/data.in new file mode 100644 index 0000000..e678525 --- /dev/null +++ b/example_geoquery/data.in @@ -0,0 +1,10 @@ + nenne alle flüsse in colorado + zähle die staaten , welche erhebungen haben , die niedriger liegen als jene in alabama + nenne mir die anzahl der flüsse in california + nenne mir die staaten , welche an utah grenzen + wie hoch ist mount mckinley + wie hoch liegt der höchste punkt in amerika + wie hoch liegt der höchste punkt in alabama + wie groß ist alaska + wie groß ist texas + wie lang ist der colorado fluss diff --git a/example_geoquery/data.prolog b/example_geoquery/data.prolog new file mode 100644 index 0000000..6843394 --- /dev/null +++ b/example_geoquery/data.prolog @@ -0,0 +1,10 @@ +answer(river(loc_2(stateid('colorado')))) +answer(count(state(low_point_2(lower_2(low_point_1(stateid('alabama'))))))) +answer(count(river(loc_2(stateid('california'))))) +answer(state(next_to_2(stateid('utah')))) +answer(elevation_1(placeid('mount mckinley'))) +answer(elevation_1(highest(place(loc_2(countryid('usa')))))) +answer(elevation_1(highest(place(loc_2(stateid('alabama')))))) +answer(size(stateid('alaska'))) +answer(size(stateid('texas'))) +answer(len(river(riverid('colorado')))) diff --git a/example_geoquery/grammar/grammar.15.gz b/example_geoquery/grammar/grammar.15.gz new file mode 100644 index 0000000..416152f Binary files /dev/null and b/example_geoquery/grammar/grammar.15.gz differ diff --git a/example_geoquery/grammar/grammar.16.gz b/example_geoquery/grammar/grammar.16.gz new file mode 100644 index 0000000..19189e6 Binary files /dev/null and b/example_geoquery/grammar/grammar.16.gz differ diff --git a/example_geoquery/grammar/grammar.25.gz b/example_geoquery/grammar/grammar.25.gz new file mode 100644 index 0000000..a441190 Binary files /dev/null and b/example_geoquery/grammar/grammar.25.gz differ diff --git a/example_geoquery/grammar/grammar.26.gz b/example_geoquery/grammar/grammar.26.gz new file mode 100644 index 0000000..753e491 Binary files /dev/null and b/example_geoquery/grammar/grammar.26.gz differ diff --git a/example_geoquery/grammar/grammar.29.gz b/example_geoquery/grammar/grammar.29.gz new file mode 100644 index 0000000..56c91cd Binary files /dev/null and b/example_geoquery/grammar/grammar.29.gz differ diff --git a/example_geoquery/grammar/grammar.3.gz b/example_geoquery/grammar/grammar.3.gz new file mode 100644 index 0000000..6e03a98 Binary files /dev/null and b/example_geoquery/grammar/grammar.3.gz differ diff --git a/example_geoquery/grammar/grammar.33.gz b/example_geoquery/grammar/grammar.33.gz new file mode 100644 index 0000000..4f58842 Binary files /dev/null and b/example_geoquery/grammar/grammar.33.gz differ diff --git a/example_geoquery/grammar/grammar.34.gz b/example_geoquery/grammar/grammar.34.gz new file mode 100644 index 0000000..a700a54 Binary files /dev/null and b/example_geoquery/grammar/grammar.34.gz differ diff --git a/example_geoquery/grammar/grammar.37.gz b/example_geoquery/grammar/grammar.37.gz new file mode 100644 index 0000000..32feb04 Binary files /dev/null and b/example_geoquery/grammar/grammar.37.gz differ diff --git a/example_geoquery/grammar/grammar.6.gz b/example_geoquery/grammar/grammar.6.gz new file mode 100644 index 0000000..bb24c62 Binary files /dev/null and b/example_geoquery/grammar/grammar.6.gz differ diff --git a/example_geoquery/run.sh b/example_geoquery/run.sh new file mode 100644 index 0000000..249c859 --- /dev/null +++ b/example_geoquery/run.sh @@ -0,0 +1,36 @@ +#!/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 \ + -u geoquery \ + -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