GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Small modification to spider dataset gen. naming · princeton-nlp/intercode@0fe1880

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • data
    • sql/spider
      • README.md
      • ic_spider_dev.json
      • transform
        • transform_spider.py
    • test
      • python_queries.csv
  • intercode/envs
    • ic_env.py
  • scripts
    • expr_multi_turn.sh
    • expr_n_turn_others.sh
    • expr_plan_solve.sh
    • expr_react.sh
  • tests
    • test_reward_sql.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎data/sql/spider/README.md‎

Copy file name to clipboardExpand all lines: data/sql/spider/README.md
+3-2Lines changed: 3 additions & 2 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@
44
* [Link](https://drive.google.com/uc?export=download&id=1TqleXec_OykOYFREKKtschzY29dUcVAQ) to Spider Dataset
55

66
## Set Up
7-
To create the `data/sql/spider/dev_spider.json` file, do the following:
7+
To recreate the `ic_spider_dev.json` file, do the following:
88
1. Download Spider dataset from the above link
99
2. Run the below script with the local path to the Spider dataset as an argument
1010
```sh
11-
python transform_spider.py --data_path <Path to spider data folder>
11+
python transform/transform_spider.py <Path to Spider dataset>
1212
```
13+
* You can also run this script on the `train` set for Spider by simply adding the `--split train` flag
1314

1415
## Dataset Description
1516
The script uses data from the `dev.json` file of the Spider dataset, mapping these original fields to the following new keys:
Collapse file

‎data/sql/spider/dev_spider.json‎ ‎data/sql/spider/ic_spider_dev.json‎data/sql/spider/dev_spider.json renamed to data/sql/spider/ic_spider_dev.json

Copy file name to clipboard
File renamed without changes.
Collapse file

‎data/sql/spider/transform/transform_spider.py‎

Copy file name to clipboardExpand all lines: data/sql/spider/transform/transform_spider.py
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
python transform_spider.py --data_path ~/Desktop/spider --split dev
1313
"""
1414
parser = argparse.ArgumentParser(description='Script to transform Spider SQL data to Intercode compatible format')
15-
parser.add_argument('--data_path', type=str, help='path to spider data folder')
16-
parser.add_argument('--split', choices=["train", "dev"], help='which data split to create data json file for')
15+
parser.add_argument('data_path', type=str, help='path to spider data folder')
16+
parser.add_argument('--split', choices=["train", "dev"], default="dev", help='which data split to create data json file for')
1717
args = parser.parse_args()
1818

1919
cut_spaces = lambda val: " ".join(val.split())
@@ -77,5 +77,5 @@ def get_hardness(db_dir: str, g: List):
7777
print(f'Skipped {skipped} pairs')
7878
random.Random(33).shuffle(transform_spider)
7979

80-
with open(f"{args.split}_spider.json", "w") as fp:
80+
with open(f"ic_spider_{args.split}.json", "w") as fp:
8181
json.dump(transform_spider, fp, indent=2)
Collapse file

‎data/test/python_queries.csv‎

Copy file name to clipboardExpand all lines: data/test/python_queries.csv
-2Lines changed: 0 additions & 2 deletions
This file was deleted.
Collapse file

‎intercode/envs/ic_env.py‎

Copy file name to clipboardExpand all lines: intercode/envs/ic_env.py
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ def __init__(self, image_name: str, **kwargs):
7575
self.image_name = image_name
7676
self.container_name = f"{self.image_name}_ic_ctr"
7777
self.container = get_container(self.container_name, self.image_name, **kwargs)
78+
self.logger.info(f"Connected to `{self.container_name}` container")
7879

7980
self.logger.info("Environment Initialized")
8081
if not self.tool_mode:
Collapse file

‎scripts/expr_multi_turn.sh‎

Copy file name to clipboardExpand all lines: scripts/expr_multi_turn.sh
+2-3Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
# !bin/bash
22

33
# Data Paths
4-
# - (SQL) ./data/sql/spider/dev_spider.json
4+
# - (SQL) ./data/sql/spider/ic_spider_dev.json
55
# - (SQL) ./data/test/sql_queries.csv
66
# - (Bash) ./data/bash/nl2bash/nl2bash.json
77
# - (Bash) ./data/test/bash_queries.json
8-
# - (Bash) ./data/test/nl2cmd.json
98

109
# Environments
1110
# - sql, bash
@@ -33,7 +32,7 @@
3332

3433
# SQL Call
3534
python -m experiments.eval_n_turn \
36-
--data_path ./data/sql/spider/dev_spider.json \
35+
--data_path ./data/sql/spider/ic_spider_dev.json \
3736
--dialogue_limit 5 \
3837
--env sql \
3938
--image_name docker-env-sql \
Collapse file

‎scripts/expr_n_turn_others.sh‎

Copy file name to clipboardExpand all lines: scripts/expr_n_turn_others.sh
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
python -m experiments.eval_n_turn_others \
2-
--data_path ./data/sql/spider/dev_spider.json \
2+
--data_path ./data/sql/spider/ic_spider_dev.json \
33
--dialogue_limit 5 \
44
--env sql \
55
--image_name docker-env-sql \
Collapse file

‎scripts/expr_plan_solve.sh‎

Copy file name to clipboardExpand all lines: scripts/expr_plan_solve.sh
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ python -m experiments.eval_plan_solve \
1212
# * Include --refine and --refine_turns for plan & solve + refine
1313
# * Include --proportion and --seed to randomize order of task instances
1414
# python -m experiments.eval_plan_solve \
15-
# --data_path ./data/sql/spider/dev_spider.json \
15+
# --data_path ./data/sql/spider/ic_spider_dev.json \
1616
# --env sql \
1717
# --image_name docker-env-sql \
1818
# --log_dir logs/experiments \
Collapse file

‎scripts/expr_react.sh‎

Copy file name to clipboardExpand all lines: scripts/expr_react.sh
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ python -m experiments.eval_react \
99

1010
# SQL Call
1111
# python -m experiments.eval_react \
12-
# --data_path ./data/sql/spider/dev_spider.json \
12+
# --data_path ./data/sql/spider/ic_spider_dev.json \
1313
# --env sql \
1414
# --image_name docker-env-sql \
1515
# --log_dir logs/experiments \
Collapse file

‎tests/test_reward_sql.py‎

Copy file name to clipboardExpand all lines: tests/test_reward_sql.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def preprocess(record: Dict) -> str:
88
db = record["extra"]["db"]
99
return f"use {db}"
1010

11-
data_path = "./data/sql/spider/dev_spider.json"
11+
data_path = "./data/sql/spider/ic_spider_dev.json"
1212
image_name = "docker-env-sql"
1313
env = SqlEnv(image_name, data_path=data_path, preprocess=preprocess)
1414
total, errors = 0, []

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.