├── .gitignore ├── README.md ├── assets ├── CSG_module_prompt_template.png ├── QE_module_prompt_template.png ├── SF_module_prompt_template.png ├── SR_module_prompt_template.png ├── e-sql-flowchart_qid_1448.png └── e-sql-pipeline.png ├── env.example ├── evaluation ├── evaluation.py ├── evaluation_ex.py ├── evaluation_f1.py ├── evaluation_utils.py └── evaluation_ves.py ├── few-shot-data └── question_enrichment_few_shot_examples.json ├── main.py ├── pipeline └── Pipeline.py ├── prompt_templates ├── candidate_sql_generation_prompt_template.txt ├── question_enrichment_prompt_template.txt ├── schema_filter_prompt_template.txt └── sql_refinement_prompt_template.txt ├── requirements.txt ├── run_evaluation.sh ├── run_main.sh └── utils ├── __init__.py ├── db_utils.py ├── openai_utils.py ├── prompt_utils.py └── retrieval_utils.py /.gitignore: -------------------------------------------------------------------------------- 1 | .env 2 | __pycache__/ 3 | *.py[cod] -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HasanAlpCaferoglu/E-SQL/HEAD/README.md -------------------------------------------------------------------------------- /assets/CSG_module_prompt_template.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HasanAlpCaferoglu/E-SQL/HEAD/assets/CSG_module_prompt_template.png -------------------------------------------------------------------------------- /assets/QE_module_prompt_template.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HasanAlpCaferoglu/E-SQL/HEAD/assets/QE_module_prompt_template.png -------------------------------------------------------------------------------- /assets/SF_module_prompt_template.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HasanAlpCaferoglu/E-SQL/HEAD/assets/SF_module_prompt_template.png -------------------------------------------------------------------------------- /assets/SR_module_prompt_template.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HasanAlpCaferoglu/E-SQL/HEAD/assets/SR_module_prompt_template.png -------------------------------------------------------------------------------- /assets/e-sql-flowchart_qid_1448.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HasanAlpCaferoglu/E-SQL/HEAD/assets/e-sql-flowchart_qid_1448.png -------------------------------------------------------------------------------- /assets/e-sql-pipeline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HasanAlpCaferoglu/E-SQL/HEAD/assets/e-sql-pipeline.png -------------------------------------------------------------------------------- /env.example: -------------------------------------------------------------------------------- 1 | BIRD_DB_PATH="../dataset/bird-sql" 2 | OPENAI_API_KEY= -------------------------------------------------------------------------------- /evaluation/evaluation.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HasanAlpCaferoglu/E-SQL/HEAD/evaluation/evaluation.py -------------------------------------------------------------------------------- /evaluation/evaluation_ex.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HasanAlpCaferoglu/E-SQL/HEAD/evaluation/evaluation_ex.py -------------------------------------------------------------------------------- /evaluation/evaluation_f1.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HasanAlpCaferoglu/E-SQL/HEAD/evaluation/evaluation_f1.py -------------------------------------------------------------------------------- /evaluation/evaluation_utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HasanAlpCaferoglu/E-SQL/HEAD/evaluation/evaluation_utils.py -------------------------------------------------------------------------------- /evaluation/evaluation_ves.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HasanAlpCaferoglu/E-SQL/HEAD/evaluation/evaluation_ves.py -------------------------------------------------------------------------------- /few-shot-data/question_enrichment_few_shot_examples.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HasanAlpCaferoglu/E-SQL/HEAD/few-shot-data/question_enrichment_few_shot_examples.json -------------------------------------------------------------------------------- /main.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HasanAlpCaferoglu/E-SQL/HEAD/main.py -------------------------------------------------------------------------------- /pipeline/Pipeline.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HasanAlpCaferoglu/E-SQL/HEAD/pipeline/Pipeline.py -------------------------------------------------------------------------------- /prompt_templates/candidate_sql_generation_prompt_template.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HasanAlpCaferoglu/E-SQL/HEAD/prompt_templates/candidate_sql_generation_prompt_template.txt -------------------------------------------------------------------------------- /prompt_templates/question_enrichment_prompt_template.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HasanAlpCaferoglu/E-SQL/HEAD/prompt_templates/question_enrichment_prompt_template.txt -------------------------------------------------------------------------------- /prompt_templates/schema_filter_prompt_template.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HasanAlpCaferoglu/E-SQL/HEAD/prompt_templates/schema_filter_prompt_template.txt -------------------------------------------------------------------------------- /prompt_templates/sql_refinement_prompt_template.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HasanAlpCaferoglu/E-SQL/HEAD/prompt_templates/sql_refinement_prompt_template.txt -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HasanAlpCaferoglu/E-SQL/HEAD/requirements.txt -------------------------------------------------------------------------------- /run_evaluation.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HasanAlpCaferoglu/E-SQL/HEAD/run_evaluation.sh -------------------------------------------------------------------------------- /run_main.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HasanAlpCaferoglu/E-SQL/HEAD/run_main.sh -------------------------------------------------------------------------------- /utils/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /utils/db_utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HasanAlpCaferoglu/E-SQL/HEAD/utils/db_utils.py -------------------------------------------------------------------------------- /utils/openai_utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HasanAlpCaferoglu/E-SQL/HEAD/utils/openai_utils.py -------------------------------------------------------------------------------- /utils/prompt_utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HasanAlpCaferoglu/E-SQL/HEAD/utils/prompt_utils.py -------------------------------------------------------------------------------- /utils/retrieval_utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HasanAlpCaferoglu/E-SQL/HEAD/utils/retrieval_utils.py --------------------------------------------------------------------------------