├── LICENSE ├── README.md ├── evaluation ├── evaluation.py ├── evaluation_SL.py └── pred_txt_to_json.py ├── few_shot ├── .DS_Store ├── construct_QA.py ├── get_example_modules.py ├── sentence_transformers │ ├── .DS_Store │ ├── 1_Pooling │ │ └── config.json │ ├── README.md │ ├── config.json │ ├── config_sentence_transformers.json │ ├── data_config.json │ ├── gitattributes │ ├── modules.json │ ├── sentence_bert_config.json │ ├── special_tokens_map.json │ ├── tokenizer.json │ ├── tokenizer_config.json │ ├── train_script.py │ └── vocab.txt ├── slg_main.py └── train-00000-of-00001-fe8894d41b7815be.parquet ├── figs ├── ablation.png ├── framework.jpg ├── main_bird.png └── schema.png ├── main_result ├── BIRD_DEV │ ├── deepseek │ │ ├── step1 │ │ │ ├── LLM.json │ │ │ └── preliminary_sql.txt │ │ ├── step2 │ │ │ ├── augmentation.json │ │ │ └── step_2_information_augmentation.txt │ │ ├── step3 │ │ │ └── step_3_binary.txt │ │ └── step4 │ │ │ └── final_sql.txt │ └── gpt-4o │ │ ├── step1 │ │ ├── LLM.json │ │ └── preliminary_sql.txt │ │ ├── step2 │ │ ├── augmentation.json │ │ └── step_2_information_augmentation.txt │ │ ├── step3 │ │ └── step_3_binary.txt │ │ └── step4 │ │ └── final_sql.txt ├── Spider_test │ ├── LLM.json │ ├── example.json │ ├── key.json │ ├── ppl_dev.json │ ├── step_1_sql.txt │ ├── step_2_sql.txt │ ├── step_3_sql.txt │ └── step_4_sql.txt └── code_on_spider.zip ├── requirements.txt └── src ├── bid_schema_linking.py ├── configs ├── Instruction.py └── config.py ├── data_construct.py ├── information ├── add_augmentation.py ├── add_example.py └── add_sl.py ├── llm ├── Binary_GPT.py ├── LLM.py └── self_correction_gpt.py ├── step_1_preliminary_sql.py ├── step_2_information_augmentation.py ├── step_3_binary_selection.py ├── step_4_self_correction.py └── utils ├── db_op.py ├── simplified_schema.py └── util.py /LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/LICENSE -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/README.md -------------------------------------------------------------------------------- /evaluation/evaluation.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/evaluation/evaluation.py -------------------------------------------------------------------------------- /evaluation/evaluation_SL.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/evaluation/evaluation_SL.py -------------------------------------------------------------------------------- /evaluation/pred_txt_to_json.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/evaluation/pred_txt_to_json.py -------------------------------------------------------------------------------- /few_shot/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/few_shot/.DS_Store -------------------------------------------------------------------------------- /few_shot/construct_QA.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/few_shot/construct_QA.py -------------------------------------------------------------------------------- /few_shot/get_example_modules.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/few_shot/get_example_modules.py -------------------------------------------------------------------------------- /few_shot/sentence_transformers/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/few_shot/sentence_transformers/.DS_Store -------------------------------------------------------------------------------- /few_shot/sentence_transformers/1_Pooling/config.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/few_shot/sentence_transformers/1_Pooling/config.json -------------------------------------------------------------------------------- /few_shot/sentence_transformers/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/few_shot/sentence_transformers/README.md -------------------------------------------------------------------------------- /few_shot/sentence_transformers/config.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/few_shot/sentence_transformers/config.json -------------------------------------------------------------------------------- /few_shot/sentence_transformers/config_sentence_transformers.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/few_shot/sentence_transformers/config_sentence_transformers.json -------------------------------------------------------------------------------- /few_shot/sentence_transformers/data_config.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/few_shot/sentence_transformers/data_config.json -------------------------------------------------------------------------------- /few_shot/sentence_transformers/gitattributes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/few_shot/sentence_transformers/gitattributes -------------------------------------------------------------------------------- /few_shot/sentence_transformers/modules.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/few_shot/sentence_transformers/modules.json -------------------------------------------------------------------------------- /few_shot/sentence_transformers/sentence_bert_config.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/few_shot/sentence_transformers/sentence_bert_config.json -------------------------------------------------------------------------------- /few_shot/sentence_transformers/special_tokens_map.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/few_shot/sentence_transformers/special_tokens_map.json -------------------------------------------------------------------------------- /few_shot/sentence_transformers/tokenizer.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/few_shot/sentence_transformers/tokenizer.json -------------------------------------------------------------------------------- /few_shot/sentence_transformers/tokenizer_config.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/few_shot/sentence_transformers/tokenizer_config.json -------------------------------------------------------------------------------- /few_shot/sentence_transformers/train_script.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/few_shot/sentence_transformers/train_script.py -------------------------------------------------------------------------------- /few_shot/sentence_transformers/vocab.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/few_shot/sentence_transformers/vocab.txt -------------------------------------------------------------------------------- /few_shot/slg_main.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/few_shot/slg_main.py -------------------------------------------------------------------------------- /few_shot/train-00000-of-00001-fe8894d41b7815be.parquet: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/few_shot/train-00000-of-00001-fe8894d41b7815be.parquet -------------------------------------------------------------------------------- /figs/ablation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/figs/ablation.png -------------------------------------------------------------------------------- /figs/framework.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/figs/framework.jpg -------------------------------------------------------------------------------- /figs/main_bird.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/figs/main_bird.png -------------------------------------------------------------------------------- /figs/schema.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/figs/schema.png -------------------------------------------------------------------------------- /main_result/BIRD_DEV/deepseek/step1/LLM.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/main_result/BIRD_DEV/deepseek/step1/LLM.json -------------------------------------------------------------------------------- /main_result/BIRD_DEV/deepseek/step1/preliminary_sql.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/main_result/BIRD_DEV/deepseek/step1/preliminary_sql.txt -------------------------------------------------------------------------------- /main_result/BIRD_DEV/deepseek/step2/augmentation.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/main_result/BIRD_DEV/deepseek/step2/augmentation.json -------------------------------------------------------------------------------- /main_result/BIRD_DEV/deepseek/step2/step_2_information_augmentation.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/main_result/BIRD_DEV/deepseek/step2/step_2_information_augmentation.txt -------------------------------------------------------------------------------- /main_result/BIRD_DEV/deepseek/step3/step_3_binary.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/main_result/BIRD_DEV/deepseek/step3/step_3_binary.txt -------------------------------------------------------------------------------- /main_result/BIRD_DEV/deepseek/step4/final_sql.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/main_result/BIRD_DEV/deepseek/step4/final_sql.txt -------------------------------------------------------------------------------- /main_result/BIRD_DEV/gpt-4o/step1/LLM.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/main_result/BIRD_DEV/gpt-4o/step1/LLM.json -------------------------------------------------------------------------------- /main_result/BIRD_DEV/gpt-4o/step1/preliminary_sql.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/main_result/BIRD_DEV/gpt-4o/step1/preliminary_sql.txt -------------------------------------------------------------------------------- /main_result/BIRD_DEV/gpt-4o/step2/augmentation.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/main_result/BIRD_DEV/gpt-4o/step2/augmentation.json -------------------------------------------------------------------------------- /main_result/BIRD_DEV/gpt-4o/step2/step_2_information_augmentation.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/main_result/BIRD_DEV/gpt-4o/step2/step_2_information_augmentation.txt -------------------------------------------------------------------------------- /main_result/BIRD_DEV/gpt-4o/step3/step_3_binary.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/main_result/BIRD_DEV/gpt-4o/step3/step_3_binary.txt -------------------------------------------------------------------------------- /main_result/BIRD_DEV/gpt-4o/step4/final_sql.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/main_result/BIRD_DEV/gpt-4o/step4/final_sql.txt -------------------------------------------------------------------------------- /main_result/Spider_test/LLM.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/main_result/Spider_test/LLM.json -------------------------------------------------------------------------------- /main_result/Spider_test/example.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/main_result/Spider_test/example.json -------------------------------------------------------------------------------- /main_result/Spider_test/key.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/main_result/Spider_test/key.json -------------------------------------------------------------------------------- /main_result/Spider_test/ppl_dev.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/main_result/Spider_test/ppl_dev.json -------------------------------------------------------------------------------- /main_result/Spider_test/step_1_sql.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/main_result/Spider_test/step_1_sql.txt -------------------------------------------------------------------------------- /main_result/Spider_test/step_2_sql.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/main_result/Spider_test/step_2_sql.txt -------------------------------------------------------------------------------- /main_result/Spider_test/step_3_sql.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/main_result/Spider_test/step_3_sql.txt -------------------------------------------------------------------------------- /main_result/Spider_test/step_4_sql.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/main_result/Spider_test/step_4_sql.txt -------------------------------------------------------------------------------- /main_result/code_on_spider.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/main_result/code_on_spider.zip -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/requirements.txt -------------------------------------------------------------------------------- /src/bid_schema_linking.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/src/bid_schema_linking.py -------------------------------------------------------------------------------- /src/configs/Instruction.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/src/configs/Instruction.py -------------------------------------------------------------------------------- /src/configs/config.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/src/configs/config.py -------------------------------------------------------------------------------- /src/data_construct.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/src/data_construct.py -------------------------------------------------------------------------------- /src/information/add_augmentation.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/src/information/add_augmentation.py -------------------------------------------------------------------------------- /src/information/add_example.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/src/information/add_example.py -------------------------------------------------------------------------------- /src/information/add_sl.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/src/information/add_sl.py -------------------------------------------------------------------------------- /src/llm/Binary_GPT.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/src/llm/Binary_GPT.py -------------------------------------------------------------------------------- /src/llm/LLM.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/src/llm/LLM.py -------------------------------------------------------------------------------- /src/llm/self_correction_gpt.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/src/llm/self_correction_gpt.py -------------------------------------------------------------------------------- /src/step_1_preliminary_sql.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/src/step_1_preliminary_sql.py -------------------------------------------------------------------------------- /src/step_2_information_augmentation.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/src/step_2_information_augmentation.py -------------------------------------------------------------------------------- /src/step_3_binary_selection.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/src/step_3_binary_selection.py -------------------------------------------------------------------------------- /src/step_4_self_correction.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/src/step_4_self_correction.py -------------------------------------------------------------------------------- /src/utils/db_op.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/src/utils/db_op.py -------------------------------------------------------------------------------- /src/utils/simplified_schema.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/src/utils/simplified_schema.py -------------------------------------------------------------------------------- /src/utils/util.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Laqcce-cao/RSL-SQL/HEAD/src/utils/util.py --------------------------------------------------------------------------------