diff --git a/README.md b/README.md index 8e7580bfc0a58fb8e475101c7708364a3858cf45..62d913d835edf9977cb1052fee934117cded009e 100644 --- a/README.md +++ b/README.md @@ -2,4 +2,11 @@ license: apache-2.0 task_categories: - question-answering ---- \ No newline at end of file +configs: +- config_name: AQUA + data_files: + - split: train + path: "aqua/train.json" + - split: test + path: "aqua/test.json" +--- diff --git a/aqua/CONTRIBUTING b/aqua/CONTRIBUTING new file mode 100644 index 0000000000000000000000000000000000000000..2827b7d3fa277e2daab95ea3cfaff1c2bfc1389e --- /dev/null +++ b/aqua/CONTRIBUTING @@ -0,0 +1,27 @@ +Want to contribute? Great! First, read this page (including the small print at the end). + +### Before you contribute +Before we can use your code, you must sign the +[Google Individual Contributor License Agreement] +(https://cla.developers.google.com/about/google-individual) +(CLA), which you can do online. The CLA is necessary mainly because you own the +copyright to your changes, even after your contribution becomes part of our +codebase, so we need your permission to use and distribute your code. We also +need to be sure of various other things—for instance that you'll tell us if you +know that your code infringes on other people's patents. You don't have to sign +the CLA until after you've submitted your code for review and a member has +approved it, but you must do it before we can put your code into our codebase. +Before you start working on a larger contribution, you should get in touch with +us first through the issue tracker with your idea so that we can help out and +possibly guide you. Coordinating up front makes it much easier to avoid +frustration later on. + +### Code reviews +All submissions, including submissions by project members, require review. We +use Github pull requests for this purpose. + +### The small print +Contributions made by corporations are covered by a different agreement than +the one above, the +[Software Grant and Corporate Contributor License Agreement] +(https://cla.developers.google.com/about/google-corporate). diff --git a/aqua/LICENSE b/aqua/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d7e363d0c7bf685f52c5a172d54aca328ca55d90 --- /dev/null +++ b/aqua/LICENSE @@ -0,0 +1,13 @@ +Copyright 2017 Google Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/aqua/README.md b/aqua/README.md new file mode 100644 index 0000000000000000000000000000000000000000..b49262b8d368c0fb0981478b555fce30bd4afd9c --- /dev/null +++ b/aqua/README.md @@ -0,0 +1,35 @@ +# AQUA-RAT (Algebra Question Answering with Rationales) Dataset + +This dataset contains the algebraic word problems with rationales described in our paper: + +[Wang Ling, Dani Yogatama, Chris Dyer, and Phil Blunsom. (2017) Program Induction by Rationale Generation: Learning to Solve and Explain Algebraic Word Problems. In Proc. ACL.](https://arxiv.org/pdf/1705.04146.pdf) + +The dataset consists of about 100,000 algebraic word problems with natural language rationales. Each problem is a json object consisting of four parts: + + * `question` - A natural language definition of the problem to solve + * `options` - 5 possible options (A, B, C, D and E), among which one is correct + * `rationale` - A natural language description of the solution to the problem + * `correct` - The correct option + +Here is an example of a problem object: + + { + "question": "A grocery sells a bag of ice for $1.25, and makes 20% profit. If it sells 500 bags of ice, how much total profit does it make?", + "options": ["A)125", "B)150", "C)225", "D)250", "E)275"], + "rationale": "Profit per bag = 1.25 * 0.20 = 0.25\nTotal profit = 500 * 0.25 = 125\nAnswer is A.", + "correct": "A" + } + +## Files + + * `train.json` -> untokenized training set + * `train.tok.json` -> tokenized training set + * `dev.json` -> untokenized development set + * `dev.tok.json` -> tokenized development set + * `test.json` -> untokenized test set + * `test.tok.json` -> tokenized test set + +## Note + +This dataset has been fully crowdsourced, as described using the technique in the paper (Ling et al., 2017). The initial published results included in the paper were derived from a previous version of this dataset that cannot be released in full, and results using the published system will differ. Results using our published system will be forthcoming. + diff --git a/aqua/dev.json b/aqua/dev.json new file mode 100644 index 0000000000000000000000000000000000000000..4ec72a3d27d3913c2e57a63f2bd80c1d33da988b --- /dev/null +++ b/aqua/dev.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4a52301d8a49ae0b286f8e697f9c5da1b109b247b825b47b4c6de34312dceec5 +size 132008 diff --git a/aqua/test.json b/aqua/test.json new file mode 100644 index 0000000000000000000000000000000000000000..19a23f92a984ebfeb56f5566052c8df8321a3635 --- /dev/null +++ b/aqua/test.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:de41581881ef95c5588c44ddc701c77fd480839241dd422a0d181262af24520c +size 130192 diff --git a/aqua/train.json b/aqua/train.json new file mode 100644 index 0000000000000000000000000000000000000000..0e2fb212f551f171e8430bb21a122c7e3b075916 --- /dev/null +++ b/aqua/train.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:35b70c7cb1660c34d302bb932dfd3656ce3d05e8c982c797767fec31d7d1e0ba +size 47570935 diff --git a/binpacking/test.csv b/binpacking/test.csv new file mode 100644 index 0000000000000000000000000000000000000000..37e6e196201261e9ff1fee88e792a439a96804bd --- /dev/null +++ b/binpacking/test.csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6afe05736bafd088c9503f86f80f9cde4164dba2f1953493c0d026918f89cc62 +size 2092 diff --git a/binpacking/train.csv b/binpacking/train.csv new file mode 100644 index 0000000000000000000000000000000000000000..7b9d504dc75d38208f791502708cb28715b0e2ab --- /dev/null +++ b/binpacking/train.csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a139e9c64a315dc63667058f62b3d86cebfcdf5c2b5f4fce8df02eae76d836f4 +size 992 diff --git a/blocksworld/AutoHD_val_set.json b/blocksworld/AutoHD_val_set.json new file mode 100644 index 0000000000000000000000000000000000000000..49d7e6e653866c037161ecf2da284943a7aeb264 --- /dev/null +++ b/blocksworld/AutoHD_val_set.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ca402514cf97b24d1e682c84c135b1730c7698a3bbebbbe35b9925df9e46b991 +size 3054 diff --git a/blocksworld/bw_basic.json b/blocksworld/bw_basic.json new file mode 100644 index 0000000000000000000000000000000000000000..476f0264538adc2f2a2253d663ab4108a2b1c148 --- /dev/null +++ b/blocksworld/bw_basic.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5f4341ea55456d9def4016c26805a8cd33e29c68aa3aa108fdf7005674845c93 +size 104423 diff --git a/blocksworld/bw_basic_sup.json b/blocksworld/bw_basic_sup.json new file mode 100644 index 0000000000000000000000000000000000000000..bf69b93b0696e67594f50d04ce13b6af23bc8497 --- /dev/null +++ b/blocksworld/bw_basic_sup.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:340d29987680ec6a6af720f023c05826ac9be61f5aa67548036096292e23662a +size 17546 diff --git a/blocksworld/bw_config.yaml b/blocksworld/bw_config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..291b77f69716570a24cf8eece2d6587082b34cec --- /dev/null +++ b/blocksworld/bw_config.yaml @@ -0,0 +1,67 @@ +--- +domain_intro: | + I am playing with a set of blocks where I need to arrange the blocks into stacks. Here are the actions I can do + + Pick up a block + Unstack a block from on top of another block + Put down a block + Stack a block on top of another block + + I have the following restrictions on my actions: + I can only pick up or unstack one block at a time. + I can only pick up or unstack a block if my hand is empty. + I can only pick up a block if the block is on the table and the block is clear. A block is clear if the block has no other blocks on top of it and if the block is not picked up. + I can only unstack a block from on top of another block if the block I am unstacking was really on top of the other block. + I can only unstack a block from on top of another block if the block I am unstacking is clear. + Once I pick up or unstack a block, I am holding the block. + I can only put down a block that I am holding. + I can only stack a block on top of another block if I am holding the block being stacked. + I can only stack a block on top of another block if the block onto which I am stacking the block is clear. + Once I put down or stack a block, my hand becomes empty. + +domain_intro_cost: | + I am playing with a set of blocks where I need to arrange the blocks into stacks. Here are the actions I can do: + + Pick up a block. It takes 1 minute to pick up a block. + Unstack a block from on top of another block. It takes 1 minute to unstack a block from on top of another block. + Put down a block. It takes 1 minute to put down a block. + Stack a block on top of another block. It takes 1 minute to stack a block on top of another block. + + I have the following restrictions on my actions: + I can only pick up or unstack one block at a time. + I can only pick up or unstack a block if my hand is empty. + I can only pick up a block if the block is on the table and the block is clear. A block is clear if the block has no other blocks on top of it and if the block is not picked up. + I can only unstack a block from on top of another block if the block I am unstacking was really on top of the other block. + I can only unstack a block from on top of another block if the block I am unstacking is clear. + Once I pick up or unstack a block, I am holding the block. + I can only put down a block that I am holding. + I can only stack a block on top of another block if I am holding the block being stacked. + I can only stack a block on top of another block if the block onto which I am stacking the block is clear. + Once I put down or stack a block, my hand becomes empty. + +actions: + {pick-up: "pick up the {}", + put-down: "put down the {}", + stack: "stack the {} on top of the {}", + unstack: "unstack the {} from on top of the {}"} + +objects: +- blue block +- orange block +- red block +- yellow block + +predicates: + {ontable: "the {} is on the table", + clear: "the {} is clear", + handempty: "the hand is empty", + "on": "the {} is on top of the {}"} + +# encoded_objects: dictionary of object names, have to be alphabetical +encoded_objects: + {"a": "red block", "b": "blue block", "c": "orange block", "d": "yellow block", + "e": "white block", "f": "magenta block", "g": "black block", "h": "cyan block", + "i": "green block", "j": "violet block", "k": "silver block", "l": "gold block" } + +callbacks: + - t1_gen_goal_directed_instances \ No newline at end of file diff --git a/blocksworld/full_data/step_10.json b/blocksworld/full_data/step_10.json new file mode 100644 index 0000000000000000000000000000000000000000..d975b8f581c6b457427da3d32c861a3779a98732 --- /dev/null +++ b/blocksworld/full_data/step_10.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fa8fdceed59da1417be2c1757608e6096894ace33431efce06d5d606610efba4 +size 27434 diff --git a/blocksworld/full_data/step_12.json b/blocksworld/full_data/step_12.json new file mode 100644 index 0000000000000000000000000000000000000000..62e648601e069e7c92938485a03dfff7beaf75e1 --- /dev/null +++ b/blocksworld/full_data/step_12.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7cd63da82e3e0ed42821145770e101d13d6c600826ab6ed4436914bab7fed86b +size 12444 diff --git a/blocksworld/full_data/step_14.json b/blocksworld/full_data/step_14.json new file mode 100644 index 0000000000000000000000000000000000000000..83109ad2c7c4957aea0adb677dd6242c4e597143 --- /dev/null +++ b/blocksworld/full_data/step_14.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:71c828272bfd6c33ee2f9eb8471707db21af32170d6af704e8d171182a40f62a +size 301 diff --git a/blocksworld/full_data/step_16.json b/blocksworld/full_data/step_16.json new file mode 100644 index 0000000000000000000000000000000000000000..72e86e1fdfb8fe2a2a95c24dfbb82293a548d540 --- /dev/null +++ b/blocksworld/full_data/step_16.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a1645a3cf3b7ac672e64b032e7ddfd92abbed8117accd092996891a4760e49ea +size 325 diff --git a/blocksworld/full_data/step_2.json b/blocksworld/full_data/step_2.json new file mode 100644 index 0000000000000000000000000000000000000000..b18614c83da5586f49fc4f9afb0706618f8b49a2 --- /dev/null +++ b/blocksworld/full_data/step_2.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a76a3ba034f333d492926331e9ead6def0c39cd5459015d68904d361a71c833e +size 7751 diff --git a/blocksworld/full_data/step_4.json b/blocksworld/full_data/step_4.json new file mode 100644 index 0000000000000000000000000000000000000000..34f675c4e0039dc3d3384af41036ae63b628e3b1 --- /dev/null +++ b/blocksworld/full_data/step_4.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d4f404f2cd85d33e9cc72e34de35d4ccd28a02dd378e4068f331496821042f9a +size 13662 diff --git a/blocksworld/full_data/step_6.json b/blocksworld/full_data/step_6.json new file mode 100644 index 0000000000000000000000000000000000000000..544133511832d7265d318796d324c82f639798d6 --- /dev/null +++ b/blocksworld/full_data/step_6.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f98dbfb28a2e7e75db9ec60f984fab5b2473a40005194584e462236463515460 +size 28929 diff --git a/blocksworld/full_data/step_8.json b/blocksworld/full_data/step_8.json new file mode 100644 index 0000000000000000000000000000000000000000..390cb16cda5e44db5040462f04943219e6b5960e --- /dev/null +++ b/blocksworld/full_data/step_8.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7b4cc634b17b2aa80be5229687e7f5646557cf1ae4023b1ea1ffd4c26ce9d581 +size 32723 diff --git a/blocksworld/generated_domain.pddl b/blocksworld/generated_domain.pddl new file mode 100644 index 0000000000000000000000000000000000000000..aee75f5b71145ea2f2a69b24aac1d158084d3dd5 --- /dev/null +++ b/blocksworld/generated_domain.pddl @@ -0,0 +1,31 @@ +(define (domain blocksworld-4ops) + (:requirements :strips) +(:predicates (clear ?x) + (ontable ?x) + (handempty) + (holding ?x) + (on ?x ?y)) + +(:action pick-up + :parameters (?ob) + :precondition (and (clear ?ob) (ontable ?ob) (handempty)) + :effect (and (holding ?ob) (not (clear ?ob)) (not (ontable ?ob)) + (not (handempty)))) + +(:action put-down + :parameters (?ob) + :precondition (holding ?ob) + :effect (and (clear ?ob) (handempty) (ontable ?ob) + (not (holding ?ob)))) + +(:action stack + :parameters (?ob ?underob) + :precondition (and (clear ?underob) (holding ?ob)) + :effect (and (handempty) (clear ?ob) (on ?ob ?underob) + (not (clear ?underob)) (not (holding ?ob)))) + +(:action unstack + :parameters (?ob ?underob) + :precondition (and (on ?ob ?underob) (clear ?ob) (handempty)) + :effect (and (holding ?ob) (clear ?underob) + (not (on ?ob ?underob)) (not (clear ?ob)) (not (handempty))))) diff --git a/blocksworld/split_v1/split_v1_step_10_data.json b/blocksworld/split_v1/split_v1_step_10_data.json new file mode 100644 index 0000000000000000000000000000000000000000..2ab5432ecec3cb5a39d9966253d28aa6825c3241 --- /dev/null +++ b/blocksworld/split_v1/split_v1_step_10_data.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8c5254a932957a8d0b8cabdf97b29f0b03d257dc3f2747d8cebcd1fba5ad39ba +size 27193 diff --git a/blocksworld/split_v1/split_v1_step_12_data.json b/blocksworld/split_v1/split_v1_step_12_data.json new file mode 100644 index 0000000000000000000000000000000000000000..f098461ae03d11a26e809af4ffa1ccde519b7999 --- /dev/null +++ b/blocksworld/split_v1/split_v1_step_12_data.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3db75637a90af2fd0bf3caf53fee0ef3ce478d13b3f19ea9775ee8566801b0e9 +size 12444 diff --git a/blocksworld/split_v1/split_v1_step_2_data.json b/blocksworld/split_v1/split_v1_step_2_data.json new file mode 100644 index 0000000000000000000000000000000000000000..62f50036bcda8ee4797471c0e6523a9523609f87 --- /dev/null +++ b/blocksworld/split_v1/split_v1_step_2_data.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c6b5b79593261e21f3419226e77cbef11b96f8085324e8ab52080d130a92904f +size 5891 diff --git a/blocksworld/split_v1/split_v1_step_4_data.json b/blocksworld/split_v1/split_v1_step_4_data.json new file mode 100644 index 0000000000000000000000000000000000000000..eefaa9a586828963f3d506bd0a1448a54b12e692 --- /dev/null +++ b/blocksworld/split_v1/split_v1_step_4_data.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e43871ae200723e57c1d3d15bc3a6738dc0b721645fad2d7087f2368aff22c40 +size 13344 diff --git a/blocksworld/split_v1/split_v1_step_6_data.json b/blocksworld/split_v1/split_v1_step_6_data.json new file mode 100644 index 0000000000000000000000000000000000000000..c39db4d076a939711c2158fae813a76cf4b5de69 --- /dev/null +++ b/blocksworld/split_v1/split_v1_step_6_data.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cc6585b9dc7891dbbbfba243357c4ebcaaccd58fedd3171a7c8bdb7c17f1de8f +size 33541 diff --git a/blocksworld/split_v1/split_v1_step_8_data.json b/blocksworld/split_v1/split_v1_step_8_data.json new file mode 100644 index 0000000000000000000000000000000000000000..27b5648d52db42af713e12a337bb0b8e883acd70 --- /dev/null +++ b/blocksworld/split_v1/split_v1_step_8_data.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1219ae2e263892de8f0d4ec2758ce30cad954c6bffb49f9f1412e571363c6688 +size 32295 diff --git a/blocksworld/split_v2/split_v2_step_10_data.json b/blocksworld/split_v2/split_v2_step_10_data.json new file mode 100644 index 0000000000000000000000000000000000000000..3c659e792d2852fceb810eb247279943ea44965a --- /dev/null +++ b/blocksworld/split_v2/split_v2_step_10_data.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8c3c34afd59dfac603e8f3af466e570e2700468b37578d199c7f459edd5f76dc +size 24999 diff --git a/blocksworld/split_v2/split_v2_step_12_data.json b/blocksworld/split_v2/split_v2_step_12_data.json new file mode 100644 index 0000000000000000000000000000000000000000..788ca70ef5133dd201de1681cef57cbf600fdabf --- /dev/null +++ b/blocksworld/split_v2/split_v2_step_12_data.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9c0a288d39e72a992710a76df63c2203bc368c9a06980b4257ef334f84c1a706 +size 9734 diff --git a/blocksworld/split_v2/split_v2_step_2_data.json b/blocksworld/split_v2/split_v2_step_2_data.json new file mode 100644 index 0000000000000000000000000000000000000000..e4e9864000e664839ae4863430c65f1a7432edcc --- /dev/null +++ b/blocksworld/split_v2/split_v2_step_2_data.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:56dd422ba6ff7eba6ff70d869e2d5b248a5a6483a30b0b291e69ca5359549b8c +size 4845 diff --git a/blocksworld/split_v2/split_v2_step_4_data.json b/blocksworld/split_v2/split_v2_step_4_data.json new file mode 100644 index 0000000000000000000000000000000000000000..510ad8799fd79b9b56f170fa9b4a9c42b9305da8 --- /dev/null +++ b/blocksworld/split_v2/split_v2_step_4_data.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fd46b5da841578a8cbee253e6415516cf1c260c89c18d4f7efab4ca36218d2bf +size 12072 diff --git a/blocksworld/split_v2/split_v2_step_6_data.json b/blocksworld/split_v2/split_v2_step_6_data.json new file mode 100644 index 0000000000000000000000000000000000000000..b043f5f1f7b691117862dc9ee42807cfe22469d3 --- /dev/null +++ b/blocksworld/split_v2/split_v2_step_6_data.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e6e702b2bb96d8fedd147ff2a00b07b209b3936db3eb78a8196f57dd24ac4c22 +size 27056 diff --git a/blocksworld/split_v2/split_v2_step_8_data.json b/blocksworld/split_v2/split_v2_step_8_data.json new file mode 100644 index 0000000000000000000000000000000000000000..77b4f84965eb78df126b9c0ec3238732e0272ea3 --- /dev/null +++ b/blocksworld/split_v2/split_v2_step_8_data.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6e63d252fc11bd52b8754c3aae3c42981f57c1ceb1ae8b04ebad989dcbe9cb66 +size 30585 diff --git a/calendarplan/output_num_days_1.bak.json b/calendarplan/output_num_days_1.bak.json new file mode 100644 index 0000000000000000000000000000000000000000..d4e60511bcfc584311c41c6b5f796a51ac242491 --- /dev/null +++ b/calendarplan/output_num_days_1.bak.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c4e1cb0589676db31525acda978560c7fe4682534cc53663ae869a094884a975 +size 3773736 diff --git a/calendarplan/output_num_days_1.json b/calendarplan/output_num_days_1.json new file mode 100644 index 0000000000000000000000000000000000000000..9ba5b6228155e459c33a0f37ab135be103b3df2a --- /dev/null +++ b/calendarplan/output_num_days_1.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1fce7a187b43daa5a263f6e205957d13ddaf4b29eb899a10f18011af3b1d6a2c +size 641337 diff --git a/calendarplan/output_num_days_2.json b/calendarplan/output_num_days_2.json new file mode 100644 index 0000000000000000000000000000000000000000..1b3603e0aca95d1189dbe559f62b0718471a3a10 --- /dev/null +++ b/calendarplan/output_num_days_2.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5266d1c3c090338db486f0f6722ce99fef217c98c7303bbfa6963da4395dc2cc +size 588288 diff --git a/calendarplan/output_num_days_3.json b/calendarplan/output_num_days_3.json new file mode 100644 index 0000000000000000000000000000000000000000..00febc68288f0b1201c0f98748410f5de8d70ab4 --- /dev/null +++ b/calendarplan/output_num_days_3.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9ba403b9af546ed1194235b5020aecdb6685bea47353726d2f2d77c4d67c9aa4 +size 678582 diff --git a/calendarplan/output_num_days_4.json b/calendarplan/output_num_days_4.json new file mode 100644 index 0000000000000000000000000000000000000000..0a499aefa95c70f91f4169a6db67b81836b559d8 --- /dev/null +++ b/calendarplan/output_num_days_4.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fd2aee50f556fe37912c40b219d4be4c2ba86b8ef4e3271ccfeedf239ab8a80d +size 793915 diff --git a/calendarplan/output_num_days_5.json b/calendarplan/output_num_days_5.json new file mode 100644 index 0000000000000000000000000000000000000000..bf26138e93d991cc5f7ef895c45aea0f710415c0 --- /dev/null +++ b/calendarplan/output_num_days_5.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:98718a3c71d6e0f45688dcb7f2244fc9e74a3e1544d0ede8017acb26344d73f9 +size 856693 diff --git a/calendarplan/output_num_people_2.json b/calendarplan/output_num_people_2.json new file mode 100644 index 0000000000000000000000000000000000000000..4905c0243605293e97604fb92aa6c8a99cdd73e6 --- /dev/null +++ b/calendarplan/output_num_people_2.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c1c22be7283bce15ac10c5be16fd7c784bae40cd5835c687dc5ca192c39a2b5c +size 3381088 diff --git a/calendarplan/output_num_people_3.json b/calendarplan/output_num_people_3.json new file mode 100644 index 0000000000000000000000000000000000000000..b007ee778cd5eb75b14781f327f8f8e80d347587 --- /dev/null +++ b/calendarplan/output_num_people_3.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d024c2ebef29b1f4a291d3588bdf0636c5d62191fd48369468deaeafb7f8d9f7 +size 530991 diff --git a/calendarplan/output_num_people_4.json b/calendarplan/output_num_people_4.json new file mode 100644 index 0000000000000000000000000000000000000000..52cf1fe9aa6dc02f884fdfe635108f706adc6185 --- /dev/null +++ b/calendarplan/output_num_people_4.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c80dbab7e18e3cde2187bbeb5771bbeb7d51dcae235dd3298592b8949e7b959c +size 608225 diff --git a/calendarplan/output_num_people_5.json b/calendarplan/output_num_people_5.json new file mode 100644 index 0000000000000000000000000000000000000000..7476fb1c4ea7ecd4d1cd92f94b4822d4689f0923 --- /dev/null +++ b/calendarplan/output_num_people_5.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e479536e188e94748b2cc7ea282c5f62db993c2973095c201a2e8b206e876861 +size 658121 diff --git a/calendarplan/output_num_people_6.json b/calendarplan/output_num_people_6.json new file mode 100644 index 0000000000000000000000000000000000000000..a5c7226876032a6d680dd227f87a9b681d2ddf3a --- /dev/null +++ b/calendarplan/output_num_people_6.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d1515cff1480af6a70cece3ee4f0a89ec7c2ef4f939435d1448238412d86ab99 +size 734979 diff --git a/calendarplan/output_num_people_7.json b/calendarplan/output_num_people_7.json new file mode 100644 index 0000000000000000000000000000000000000000..61526f8d1cd33b5397e971ae02759e7e738e7302 --- /dev/null +++ b/calendarplan/output_num_people_7.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5134848bfd9c691b0aa557b6e16155c016f46a8c7c89bab69ef68853de8cdca4 +size 777812 diff --git a/cube/cube_test.csv b/cube/cube_test.csv new file mode 100644 index 0000000000000000000000000000000000000000..bcd35ecb361dd8b233704b9e941484c6800b5575 --- /dev/null +++ b/cube/cube_test.csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:25e4368322fc880a49506101cef8c1519a0b519c184b3eeea79a041ab5e19503 +size 11243 diff --git a/cube/cube_train.csv b/cube/cube_train.csv new file mode 100644 index 0000000000000000000000000000000000000000..b957d486103092204b5384b90d49ac4fc865e32e --- /dev/null +++ b/cube/cube_train.csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5e562449c72488011ce15d927421a61db21adf2a7a46b24c218eaba3fb0f45ef +size 60136 diff --git a/cube/cube_train_subset.csv b/cube/cube_train_subset.csv new file mode 100644 index 0000000000000000000000000000000000000000..1ce02b9b659a6debcf65b6c9bace7fca039930d0 --- /dev/null +++ b/cube/cube_train_subset.csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:660a0aaf1ec700fec42ead251cb7f5fdcfbb1c542a9202f545f1fe892d80b3cd +size 1104 diff --git a/cube/data.csv b/cube/data.csv new file mode 100644 index 0000000000000000000000000000000000000000..bcd35ecb361dd8b233704b9e941484c6800b5575 --- /dev/null +++ b/cube/data.csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:25e4368322fc880a49506101cef8c1519a0b519c184b3eeea79a041ab5e19503 +size 11243 diff --git a/game24/24.csv b/game24/24.csv new file mode 100644 index 0000000000000000000000000000000000000000..44dac89071a06cadb4ed1507b6817f705a690478 --- /dev/null +++ b/game24/24.csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b9f12b3e36d987a3c714c4cef17d89a137d7c59da26532fcfb93b4821d8111b5 +size 48235 diff --git a/game24/val-autohd.csv b/game24/val-autohd.csv new file mode 100644 index 0000000000000000000000000000000000000000..e4448d58932cf9415184cc6cc767757f7a6ec65d --- /dev/null +++ b/game24/val-autohd.csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5e1f4ce68b3fe17cf5b0964f8877bc9a22ca3d5d08a4a294a13cad165344d06e +size 337 diff --git a/hotpotQA/data.json b/hotpotQA/data.json new file mode 100644 index 0000000000000000000000000000000000000000..6fcabc811830ac1fe75759293583793c40a8387f --- /dev/null +++ b/hotpotQA/data.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b207f4a48e9349af5f8c6580aa7eed03648aa926d1772e7eb594fbc537915e7f +size 95840 diff --git a/hotpotQA/full_data.json b/hotpotQA/full_data.json new file mode 100644 index 0000000000000000000000000000000000000000..bcb51fd167655b7280e9b4f351135317d7903843 --- /dev/null +++ b/hotpotQA/full_data.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:532223bb1e6fff46c164951003fce66c3f0d13d43642d496557ddfca05ba24c8 +size 1430789 diff --git a/prontoqa/345hop_random_true.json b/prontoqa/345hop_random_true.json new file mode 100644 index 0000000000000000000000000000000000000000..ffdbc06c99010157c5db7fc85557bb821bcedaa7 --- /dev/null +++ b/prontoqa/345hop_random_true.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f72eaf608740f69b2115f967150b864677ea94b08b7b17a935dc81781147aae7 +size 3281978 diff --git a/prontoqa/create_example_pool.py b/prontoqa/create_example_pool.py new file mode 100644 index 0000000000000000000000000000000000000000..870f509944c5bc3323215b699f2e42c6ef98d5cf --- /dev/null +++ b/prontoqa/create_example_pool.py @@ -0,0 +1,43 @@ +import json + +def extract_unique_in_context_examples(input_file, output_file): + # Read the original JSON file + with open(input_file, 'r') as file: + data = json.load(file) + + # Set for tracking unique examples and test questions + unique_examples = set() + test_questions = set() + + # First, collect all test questions + for key, value in data.items(): + if "test_example" in value: + test_question = json.dumps(value["test_example"]["question"], sort_keys=True) + test_questions.add(test_question) + + # List to store unique in-context examples + example_pool = [] + + # Extract unique in-context examples + for key, value in data.items(): + for example_key, example_value in value.items(): + if 'in_context_example' in example_key: + # Convert the example to a JSON string for comparison + example_str = json.dumps(example_value["question"], sort_keys=True) + if example_str not in unique_examples and example_str not in test_questions: + unique_examples.add(example_str) + example_pool.append(example_value) + + # Create the final dictionary with the example pool + print(len(example_pool)) + final_data = {"example_pool": example_pool} + + # Write the extracted data to a new JSON file + with open(output_file, 'w') as file: + json.dump(final_data, file, indent=4) + + +# Usage +input_file = '345hop_random_true.json' +output_file = 'example_pool.json' +extract_unique_in_context_examples(input_file, output_file) diff --git a/prontoqa/create_next_step_example.py b/prontoqa/create_next_step_example.py new file mode 100644 index 0000000000000000000000000000000000000000..ea9e4dd8181f1a8b4a63a7bfdc183b28a14f9c34 --- /dev/null +++ b/prontoqa/create_next_step_example.py @@ -0,0 +1,75 @@ +# import json + +# def convert_to_next_steps(example_pool): +# next_steps_list = [] + +# for example in example_pool: +# facts = example['question'].split('. ')[:-1] +# query = example['query'] +# chain_of_thought = example['chain_of_thought'] + +# claims = [] +# next_steps = [] + +# for j in range(0, len(chain_of_thought), 2): +# claim = chain_of_thought[j] +# next_step = 'Finish.' if j + 1 >= len(chain_of_thought) else chain_of_thought[j + 1] + +# claims.append(claim) +# next_steps.append(next_step) + +# next_steps_entry = { +# 'Facts': '. '.join(facts) + '.', +# 'Query': query, +# 'claims': claims, +# 'next_steps': next_steps +# } + +# next_steps_list.append(next_steps_entry) + +# return next_steps_list + +# # Read the example pool from a JSON file +# with open('example_pool.json', 'r') as file: +# example_pool = json.load(file)['example_pool'] + +# # Process the data +# next_steps = convert_to_next_steps(example_pool) + +# # Write the next steps to a JSON file +# with open('example_next_steps.json', 'w') as file: +# json.dump({"next_steps": next_steps}, file, indent=4) + +# print("Next steps have been saved to next_steps.json") + + +import json +import random + +with open(file_path, 'r') as file: + data = json.load(file)['next_steps'] + + # Sample 'sample_size' entries from the data + sampled_data = random.sample(data, sample_size) + + +def format_examples(sampled_data): + formatted_examples = "" + for i, entry in enumerate(sampled_data, 1): + facts = f"Facts {i}: {entry['Facts']}\n" + query = f"Query {i}: {entry['Query']}\n" + claims_and_next = "" + + for j, (claim, next_step) in enumerate(zip(entry['claims'], entry['next_steps']), 1): + claims_and_next += f"Claim {i}.{j}: {claim}\nNext {i}.{j}: {next_step}\n" + + formatted_examples += facts + query + claims_and_next + "\n" + + return formatted_examples + +# Example usage +file_path = 'example_next_steps.json' +sample_size = 2 # Change this to the desired sample size +formatted_text = format_examples(file_path, sample_size) + +print("EXAMPLES = \"\"\"\n" + formatted_text + "\"\"\"") \ No newline at end of file diff --git a/prontoqa/dataset.py b/prontoqa/dataset.py new file mode 100644 index 0000000000000000000000000000000000000000..7ab960bf86082c9c1ea6513a2affa072300cb925 --- /dev/null +++ b/prontoqa/dataset.py @@ -0,0 +1,64 @@ +from dataclasses import dataclass, field +from typing import List, Dict, Iterator, Mapping + +import json +from dataclasses import dataclass, field +from typing import List, Dict, Iterator, Union + + +@dataclass +class ProntoQAProblem: + question: str + query: str + chain_of_thought: List[str] + answer: str + + +@dataclass +class ProntoQAExample: + in_context_examples: Mapping[str, ProntoQAProblem] + test_example: ProntoQAProblem = field(default=None) + """ + ProntoQAProblem(question='Every cat is a feline. Mammals are vertebrates. Bilaterians are animals. Vertebrates are chordates. Carnivores are mammals. Mammals are not cold-blooded. Each chordate is a bilaterian. Every feline is a carnivore. Snakes are cold-blooded. Animals are not unicellular. Every carnivore is not herbivorous. Fae is a cat.', query='True or false: Fae is not cold-blooded.', chain_of_thought=['Fae is a cat.', 'Every cat is a feline.', 'Fae is a feline.', 'Every feline is a carnivore.', 'Fae is a carnivore.', 'Carnivores are mammals.', 'Fae is a mammal.', 'Mammals are not cold-blooded.', 'Fae is not cold-blooded.'], answer='True')""" + + + +@dataclass +class ProntoQADataset: + examples: Dict[str, ProntoQAExample] = field(default_factory=dict) + # "example1": ..., "example2": ..., ... + + @classmethod + def from_file(cls, file_path: str) -> 'ProntoQADataset': + instance = cls() + with open(file_path, 'r') as f: + raw_data = json.load(f) + + for example_key, example_value in raw_data.items(): + + all_examples = { + k: ProntoQAProblem( + question=e["question"], + query=e["query"], + chain_of_thought=e["chain_of_thought"], + answer=e["answer"] + ) for k, e in example_value.items() + } + + test_example = all_examples.pop('test_example', None) + in_context_examples = [] + + instance.examples[example_key] = ProntoQAExample(in_context_examples, test_example) + + return instance + + def __iter__(self) -> Iterator[Union[ProntoQAProblem, ProntoQAExample]]: + return iter(self.examples.values()) + + +# Sample usage +if __name__ == "__main__": + pronto_qa_dataset = ProntoQADataset.from_file('/Users/xiyan/Downloads/345hop_random_true.json') + + for example in pronto_qa_dataset: + print(example) \ No newline at end of file diff --git a/prontoqa/example_pool.json b/prontoqa/example_pool.json new file mode 100644 index 0000000000000000000000000000000000000000..91d202fc043c4e3cc2460b6459cfed409c3b9e76 --- /dev/null +++ b/prontoqa/example_pool.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:44a21d8991cbd4ac7e8ae21645e68310727d8c6e1e24ec9c33d52be60fd59562 +size 3449107 diff --git a/strategyqa/strategyqa_test.json b/strategyqa/strategyqa_test.json new file mode 100644 index 0000000000000000000000000000000000000000..c8f8baf9d2f2de34ea2e54843f34c42b7e3e0292 --- /dev/null +++ b/strategyqa/strategyqa_test.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:80665aa8383acc4c3fd009ec9d802ea7a23ab44b7428afb43f0c30aa2ada6d37 +size 379284 diff --git a/tripplan/test_TripPlan-cities-10.json b/tripplan/test_TripPlan-cities-10.json new file mode 100644 index 0000000000000000000000000000000000000000..5e674f365e170c00d0571c0db4200984f8f74dee --- /dev/null +++ b/tripplan/test_TripPlan-cities-10.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f7b7b896ba711a26d537c14d2517fdc5e714ae166fa6c2b37a0847e37751e4d2 +size 4362018 diff --git a/tripplan/test_TripPlan-cities-3.json b/tripplan/test_TripPlan-cities-3.json new file mode 100644 index 0000000000000000000000000000000000000000..9d075c5f41562c367e9fcbe3a5df6a6322a3f62f --- /dev/null +++ b/tripplan/test_TripPlan-cities-3.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:05c66ab88dcaf2fb5653467b33d8e92d9c138a2d8865dd754ffea13a2f5885ed +size 1404694 diff --git a/tripplan/test_TripPlan-cities-4.json b/tripplan/test_TripPlan-cities-4.json new file mode 100644 index 0000000000000000000000000000000000000000..9bcc6840432c62a18e94a9b9dd4dbf4b1c62b90e --- /dev/null +++ b/tripplan/test_TripPlan-cities-4.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b1e8c1b7635baf197fda85f5ee446e2ccec9a59c6967a08ba7b1f56b3d90e1e3 +size 1810441 diff --git a/tripplan/test_TripPlan-cities-5.json b/tripplan/test_TripPlan-cities-5.json new file mode 100644 index 0000000000000000000000000000000000000000..0d26fc89eb3c397f438287c0928bc26f8b5e67d9 --- /dev/null +++ b/tripplan/test_TripPlan-cities-5.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c3b67245bf9c1f34f2791a629651ae4d49d4afa09b51720e77de1874475d3998 +size 2096618 diff --git a/tripplan/test_TripPlan-cities-6.json b/tripplan/test_TripPlan-cities-6.json new file mode 100644 index 0000000000000000000000000000000000000000..aa82bbb8aa6607e8ff7cbdb865129d14d2b7922a --- /dev/null +++ b/tripplan/test_TripPlan-cities-6.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b7bd2864647195102bf60250187bbc3d2e98254998271263951097e0cb661abc +size 2507561 diff --git a/tripplan/test_TripPlan-cities-7.json b/tripplan/test_TripPlan-cities-7.json new file mode 100644 index 0000000000000000000000000000000000000000..30dd4d8bee4ac3a272f465ae8abb6942d09d4d45 --- /dev/null +++ b/tripplan/test_TripPlan-cities-7.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:21e66e20b8817d3cfe1ba7a47e0402ba2e07eab1a3e94c264ea70ffda8b978d5 +size 2830151 diff --git a/tripplan/test_TripPlan-cities-8.json b/tripplan/test_TripPlan-cities-8.json new file mode 100644 index 0000000000000000000000000000000000000000..730f7774fcb8e5665c965d77c2fdf76739777567 --- /dev/null +++ b/tripplan/test_TripPlan-cities-8.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0e0100041ab0ae787cc9549d34e90de63e8b907515203d66b7201b5c693c1969 +size 3296638 diff --git a/tripplan/test_TripPlan-cities-9.json b/tripplan/test_TripPlan-cities-9.json new file mode 100644 index 0000000000000000000000000000000000000000..d912f33e3fc7572a148f11f67197286f8175129f --- /dev/null +++ b/tripplan/test_TripPlan-cities-9.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1233725f2233e97125dd4e480d4c4ca62258254f72716d01d4d73dcef25e23e5 +size 3800865 diff --git a/tripplan/test_TripPlan-config.json b/tripplan/test_TripPlan-config.json new file mode 100644 index 0000000000000000000000000000000000000000..c3e160166e9768a3f45f5a0ae6033dbd9c68d6e9 --- /dev/null +++ b/tripplan/test_TripPlan-config.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0b8c65056f4d51da9dfa86699d23247b111d5303da6ab9440cd104f015f0b6ca +size 22155862 diff --git a/tripplan/test_TripPlan.json b/tripplan/test_TripPlan.json new file mode 100644 index 0000000000000000000000000000000000000000..e9c9a0e03809219198d4909efd55fcef5d819e43 --- /dev/null +++ b/tripplan/test_TripPlan.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7fbb96645b236d060003da5debda63a094707b7f0683088457cc13491a4b8fd0 +size 19095327