text2sql-eval-toolkit 1.0.0__tar.gz → 1.4.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- text2sql_eval_toolkit-1.4.0/MANIFEST.in +7 -0
- {text2sql_eval_toolkit-1.0.0/src/text2sql_eval_toolkit.egg-info → text2sql_eval_toolkit-1.4.0}/PKG-INFO +139 -23
- text2sql_eval_toolkit-1.0.0/PKG-INFO → text2sql_eval_toolkit-1.4.0/README.md +108 -69
- text2sql_eval_toolkit-1.4.0/dashboard/dist/assets/BenchmarkDetail-gEcRuzmW.js +4 -0
- text2sql_eval_toolkit-1.4.0/dashboard/dist/assets/ComboBox-BActzty7.js +1 -0
- text2sql_eval_toolkit-1.4.0/dashboard/dist/assets/ErrorAnalysis-BpplWvLW.js +1 -0
- text2sql_eval_toolkit-1.4.0/dashboard/dist/assets/LLMJudgeConfigView-DXZQKioY.js +10 -0
- text2sql_eval_toolkit-1.4.0/dashboard/dist/assets/MyKeysView-C2Rv1Cl-.js +1 -0
- text2sql_eval_toolkit-1.4.0/dashboard/dist/assets/PipelineCompareView-DCWeNB6f.js +1 -0
- text2sql_eval_toolkit-1.4.0/dashboard/dist/assets/PipelineDetailView-CJ47IIYR.js +1 -0
- text2sql_eval_toolkit-1.4.0/dashboard/dist/assets/ProfileCompareView-Duatpnp_.js +1 -0
- text2sql_eval_toolkit-1.4.0/dashboard/dist/assets/ResultTableView-C-syf-qW.js +1 -0
- text2sql_eval_toolkit-1.4.0/dashboard/dist/assets/RunEvaluationView-BlDUxpfZ.js +57 -0
- text2sql_eval_toolkit-1.4.0/dashboard/dist/assets/ToolkitInsightsView-aJzjMILB.js +1 -0
- text2sql_eval_toolkit-1.4.0/dashboard/dist/assets/UsersView-NPDbJBVn.js +1 -0
- text2sql_eval_toolkit-1.4.0/dashboard/dist/assets/defaultItemToString-ClUBp4QC.js +9 -0
- text2sql_eval_toolkit-1.4.0/dashboard/dist/assets/github-DKhhs9_z.png +0 -0
- text2sql_eval_toolkit-1.4.0/dashboard/dist/assets/index-BIrgjfvi.css +1 -0
- text2sql_eval_toolkit-1.4.0/dashboard/dist/assets/index-DLyduwv0.js +97 -0
- text2sql_eval_toolkit-1.4.0/dashboard/dist/assets/metricInsightsSelect-unZgHJkx.js +1 -0
- text2sql_eval_toolkit-1.4.0/dashboard/dist/assets/text2sql-eval-toolkit-logo-BPykp9hG.png +0 -0
- text2sql_eval_toolkit-1.4.0/dashboard/dist/index.html +14 -0
- text2sql_eval_toolkit-1.4.0/pyproject.toml +215 -0
- text2sql_eval_toolkit-1.4.0/setup.py +52 -0
- {text2sql_eval_toolkit-1.0.0 → text2sql_eval_toolkit-1.4.0}/src/text2sql_eval_toolkit/__init__.py +21 -2
- text2sql_eval_toolkit-1.4.0/src/text2sql_eval_toolkit/_version.py +36 -0
- {text2sql_eval_toolkit-1.0.0/src/text2sql_eval_toolkit/execution → text2sql_eval_toolkit-1.4.0/src/text2sql_eval_toolkit/analysis}/__init__.py +0 -1
- {text2sql_eval_toolkit-1.0.0 → text2sql_eval_toolkit-1.4.0}/src/text2sql_eval_toolkit/analysis/error_analysis.py +70 -19
- {text2sql_eval_toolkit-1.0.0 → text2sql_eval_toolkit-1.4.0}/src/text2sql_eval_toolkit/analysis/report_tools.py +68 -32
- text2sql_eval_toolkit-1.4.0/src/text2sql_eval_toolkit/cli.py +381 -0
- {text2sql_eval_toolkit-1.0.0 → text2sql_eval_toolkit-1.4.0}/src/text2sql_eval_toolkit/config_args.py +1 -1
- {text2sql_eval_toolkit-1.0.0 → text2sql_eval_toolkit-1.4.0}/src/text2sql_eval_toolkit/data/__init__.py +0 -1
- {text2sql_eval_toolkit-1.0.0 → text2sql_eval_toolkit-1.4.0}/src/text2sql_eval_toolkit/data/benchmarks.json +64 -47
- {text2sql_eval_toolkit-1.0.0 → text2sql_eval_toolkit-1.4.0}/src/text2sql_eval_toolkit/data/test-benchmarks.json +54 -54
- {text2sql_eval_toolkit-1.0.0 → text2sql_eval_toolkit-1.4.0}/src/text2sql_eval_toolkit/env_loader.py +25 -9
- {text2sql_eval_toolkit-1.0.0 → text2sql_eval_toolkit-1.4.0}/src/text2sql_eval_toolkit/evaluation/__init__.py +1 -2
- {text2sql_eval_toolkit-1.0.0 → text2sql_eval_toolkit-1.4.0}/src/text2sql_eval_toolkit/evaluation/evaluation_tools.py +346 -60
- text2sql_eval_toolkit-1.4.0/src/text2sql_eval_toolkit/evaluation/llm_as_judge.py +187 -0
- text2sql_eval_toolkit-1.4.0/src/text2sql_eval_toolkit/evaluation/llm_judge_config/llm_judge_alt_config.yaml +43 -0
- text2sql_eval_toolkit-1.4.0/src/text2sql_eval_toolkit/evaluation/llm_judge_config/llm_judge_default_config.yaml +43 -0
- text2sql_eval_toolkit-1.4.0/src/text2sql_eval_toolkit/evaluation/llm_judge_config/llm_judge_no_gt_v1.yaml +38 -0
- text2sql_eval_toolkit-1.4.0/src/text2sql_eval_toolkit/evaluation/llm_judge_config/llm_judge_no_gt_v2.yaml +38 -0
- text2sql_eval_toolkit-1.4.0/src/text2sql_eval_toolkit/evaluation/metric_definitions.py +194 -0
- {text2sql_eval_toolkit-1.0.0/src/text2sql_eval_toolkit/analysis → text2sql_eval_toolkit-1.4.0/src/text2sql_eval_toolkit/execution}/__init__.py +0 -1
- {text2sql_eval_toolkit-1.0.0 → text2sql_eval_toolkit-1.4.0}/src/text2sql_eval_toolkit/execution/execution_tools.py +194 -47
- {text2sql_eval_toolkit-1.0.0 → text2sql_eval_toolkit-1.4.0}/src/text2sql_eval_toolkit/execution/replace_select_tool.py +2 -2
- text2sql_eval_toolkit-1.4.0/src/text2sql_eval_toolkit/indexing/__init__.py +30 -0
- text2sql_eval_toolkit-1.4.0/src/text2sql_eval_toolkit/indexing/builder.py +427 -0
- text2sql_eval_toolkit-1.4.0/src/text2sql_eval_toolkit/indexing/scanner.py +119 -0
- text2sql_eval_toolkit-1.4.0/src/text2sql_eval_toolkit/indexing/store.py +572 -0
- {text2sql_eval_toolkit-1.0.0 → text2sql_eval_toolkit-1.4.0}/src/text2sql_eval_toolkit/inference/__init__.py +0 -1
- {text2sql_eval_toolkit-1.0.0 → text2sql_eval_toolkit-1.4.0}/src/text2sql_eval_toolkit/inference/agentic_pipeline.py +96 -66
- {text2sql_eval_toolkit-1.0.0 → text2sql_eval_toolkit-1.4.0}/src/text2sql_eval_toolkit/inference/base_pipeline.py +2 -1
- {text2sql_eval_toolkit-1.0.0 → text2sql_eval_toolkit-1.4.0}/src/text2sql_eval_toolkit/inference/baseline_llm_pipeline.py +77 -42
- {text2sql_eval_toolkit-1.0.0 → text2sql_eval_toolkit-1.4.0}/src/text2sql_eval_toolkit/inference/inference_tools.py +464 -88
- text2sql_eval_toolkit-1.4.0/src/text2sql_eval_toolkit/inference/model_clients.py +341 -0
- text2sql_eval_toolkit-1.4.0/src/text2sql_eval_toolkit/logging.py +99 -0
- text2sql_eval_toolkit-1.4.0/src/text2sql_eval_toolkit/metrics/__init__.py +66 -0
- text2sql_eval_toolkit-1.4.0/src/text2sql_eval_toolkit/metrics/text2sql_utils.py +1318 -0
- {text2sql_eval_toolkit-1.0.0 → text2sql_eval_toolkit-1.4.0}/src/text2sql_eval_toolkit/profiling/profiling_tools.py +39 -2
- text2sql_eval_toolkit-1.4.0/src/text2sql_eval_toolkit/results/__init__.py +30 -0
- text2sql_eval_toolkit-1.4.0/src/text2sql_eval_toolkit/results/_hub.py +371 -0
- text2sql_eval_toolkit-1.4.0/src/text2sql_eval_toolkit/ui/__init__.py +3 -0
- text2sql_eval_toolkit-1.4.0/src/text2sql_eval_toolkit/ui/aliases.py +91 -0
- text2sql_eval_toolkit-1.4.0/src/text2sql_eval_toolkit/ui/auth.py +169 -0
- text2sql_eval_toolkit-1.4.0/src/text2sql_eval_toolkit/ui/capabilities.py +239 -0
- text2sql_eval_toolkit-1.4.0/src/text2sql_eval_toolkit/ui/dataframes.py +77 -0
- text2sql_eval_toolkit-1.4.0/src/text2sql_eval_toolkit/ui/indexes.py +131 -0
- text2sql_eval_toolkit-1.4.0/src/text2sql_eval_toolkit/ui/jobs.py +33 -0
- text2sql_eval_toolkit-1.4.0/src/text2sql_eval_toolkit/ui/judge_budget.py +414 -0
- text2sql_eval_toolkit-1.4.0/src/text2sql_eval_toolkit/ui/middleware.py +326 -0
- text2sql_eval_toolkit-1.4.0/src/text2sql_eval_toolkit/ui/models.py +388 -0
- text2sql_eval_toolkit-1.4.0/src/text2sql_eval_toolkit/ui/paths.py +153 -0
- text2sql_eval_toolkit-1.4.0/src/text2sql_eval_toolkit/ui/registry.py +168 -0
- text2sql_eval_toolkit-1.4.0/src/text2sql_eval_toolkit/ui/roles.py +230 -0
- text2sql_eval_toolkit-1.4.0/src/text2sql_eval_toolkit/ui/routers_auth.py +145 -0
- text2sql_eval_toolkit-1.4.0/src/text2sql_eval_toolkit/ui/routers_benchmarks.py +509 -0
- text2sql_eval_toolkit-1.4.0/src/text2sql_eval_toolkit/ui/routers_compare.py +234 -0
- text2sql_eval_toolkit-1.4.0/src/text2sql_eval_toolkit/ui/routers_errors.py +208 -0
- text2sql_eval_toolkit-1.4.0/src/text2sql_eval_toolkit/ui/routers_execution.py +771 -0
- text2sql_eval_toolkit-1.4.0/src/text2sql_eval_toolkit/ui/routers_jobs.py +85 -0
- text2sql_eval_toolkit-1.4.0/src/text2sql_eval_toolkit/ui/routers_judge.py +380 -0
- text2sql_eval_toolkit-1.4.0/src/text2sql_eval_toolkit/ui/routers_judge_configs.py +171 -0
- text2sql_eval_toolkit-1.4.0/src/text2sql_eval_toolkit/ui/routers_keys.py +106 -0
- text2sql_eval_toolkit-1.4.0/src/text2sql_eval_toolkit/ui/routers_results.py +123 -0
- text2sql_eval_toolkit-1.4.0/src/text2sql_eval_toolkit/ui/routers_users.py +174 -0
- text2sql_eval_toolkit-1.4.0/src/text2sql_eval_toolkit/ui/runtime.py +177 -0
- text2sql_eval_toolkit-1.4.0/src/text2sql_eval_toolkit/ui/server.py +454 -0
- text2sql_eval_toolkit-1.4.0/src/text2sql_eval_toolkit/ui/static_files.py +251 -0
- text2sql_eval_toolkit-1.4.0/src/text2sql_eval_toolkit/ui/user_keys.py +322 -0
- text2sql_eval_toolkit-1.4.0/src/text2sql_eval_toolkit/utils.py +598 -0
- text2sql_eval_toolkit-1.0.0/README.md → text2sql_eval_toolkit-1.4.0/src/text2sql_eval_toolkit.egg-info/PKG-INFO +185 -21
- text2sql_eval_toolkit-1.4.0/src/text2sql_eval_toolkit.egg-info/SOURCES.txt +134 -0
- text2sql_eval_toolkit-1.4.0/src/text2sql_eval_toolkit.egg-info/entry_points.txt +3 -0
- {text2sql_eval_toolkit-1.0.0 → text2sql_eval_toolkit-1.4.0}/src/text2sql_eval_toolkit.egg-info/requires.txt +30 -1
- text2sql_eval_toolkit-1.4.0/tests/test_auth_google.py +226 -0
- text2sql_eval_toolkit-1.4.0/tests/test_capability_tiers.py +445 -0
- text2sql_eval_toolkit-1.4.0/tests/test_category_summary_differential.py +185 -0
- text2sql_eval_toolkit-1.4.0/tests/test_copilot_review_fixes.py +171 -0
- text2sql_eval_toolkit-1.4.0/tests/test_dashboard_api_index.py +438 -0
- text2sql_eval_toolkit-1.4.0/tests/test_dashboard_spa_routing.py +204 -0
- text2sql_eval_toolkit-1.4.0/tests/test_dataframe_previews.py +204 -0
- text2sql_eval_toolkit-1.4.0/tests/test_documented_defect_fixes.py +184 -0
- text2sql_eval_toolkit-1.4.0/tests/test_error_analysis.py +286 -0
- text2sql_eval_toolkit-1.4.0/tests/test_evaluate_prediction.py +327 -0
- text2sql_eval_toolkit-1.4.0/tests/test_index_concurrency.py +156 -0
- text2sql_eval_toolkit-1.4.0/tests/test_indexing_builder.py +209 -0
- text2sql_eval_toolkit-1.4.0/tests/test_indexing_differential.py +233 -0
- text2sql_eval_toolkit-1.4.0/tests/test_indexing_scanner.py +93 -0
- text2sql_eval_toolkit-1.4.0/tests/test_judge_config_storage.py +147 -0
- text2sql_eval_toolkit-1.4.0/tests/test_judge_endpoint.py +367 -0
- text2sql_eval_toolkit-1.4.0/tests/test_library_internals.py +287 -0
- text2sql_eval_toolkit-1.4.0/tests/test_logging_setup.py +193 -0
- text2sql_eval_toolkit-1.4.0/tests/test_model_client_dispatch.py +217 -0
- text2sql_eval_toolkit-1.4.0/tests/test_pipeline_aliases.py +190 -0
- text2sql_eval_toolkit-1.4.0/tests/test_proxy_forwarding.py +142 -0
- text2sql_eval_toolkit-1.4.0/tests/test_public_api.py +141 -0
- text2sql_eval_toolkit-1.4.0/tests/test_public_api_behaviour.py +428 -0
- text2sql_eval_toolkit-1.4.0/tests/test_public_api_signatures.py +127 -0
- text2sql_eval_toolkit-1.4.0/tests/test_registry_sync.py +86 -0
- text2sql_eval_toolkit-1.4.0/tests/test_report_tools.py +294 -0
- text2sql_eval_toolkit-1.4.0/tests/test_route_table.py +103 -0
- {text2sql_eval_toolkit-1.0.0 → text2sql_eval_toolkit-1.4.0}/tests/test_run_experiment_behavior.py +0 -1
- {text2sql_eval_toolkit-1.0.0 → text2sql_eval_toolkit-1.4.0}/tests/test_run_experiment_integration.py +7 -6
- text2sql_eval_toolkit-1.4.0/tests/test_security_hardening.py +338 -0
- text2sql_eval_toolkit-1.4.0/tests/test_sqlite_db_resolution.py +106 -0
- text2sql_eval_toolkit-1.4.0/tests/test_sqlite_readonly.py +142 -0
- text2sql_eval_toolkit-1.4.0/tests/test_text2sql_metrics.py +39 -0
- text2sql_eval_toolkit-1.4.0/tests/test_user_api_keys.py +294 -0
- text2sql_eval_toolkit-1.4.0/tests/test_user_management.py +219 -0
- text2sql_eval_toolkit-1.0.0/pyproject.toml +0 -73
- text2sql_eval_toolkit-1.0.0/src/text2sql_eval_toolkit/evaluation/llm_as_judge.py +0 -90
- text2sql_eval_toolkit-1.0.0/src/text2sql_eval_toolkit/logging.py +0 -54
- text2sql_eval_toolkit-1.0.0/src/text2sql_eval_toolkit/utils.py +0 -302
- text2sql_eval_toolkit-1.0.0/src/text2sql_eval_toolkit.egg-info/SOURCES.txt +0 -36
- text2sql_eval_toolkit-1.0.0/tests/test_public_api.py +0 -40
- {text2sql_eval_toolkit-1.0.0 → text2sql_eval_toolkit-1.4.0}/LICENSE +0 -0
- {text2sql_eval_toolkit-1.0.0 → text2sql_eval_toolkit-1.4.0}/setup.cfg +0 -0
- {text2sql_eval_toolkit-1.0.0 → text2sql_eval_toolkit-1.4.0}/src/text2sql_eval_toolkit.egg-info/dependency_links.txt +0 -0
- {text2sql_eval_toolkit-1.0.0 → text2sql_eval_toolkit-1.4.0}/src/text2sql_eval_toolkit.egg-info/top_level.txt +0 -0
- {text2sql_eval_toolkit-1.0.0 → text2sql_eval_toolkit-1.4.0}/tests/test_inference_tools.py +0 -0
- {text2sql_eval_toolkit-1.0.0 → text2sql_eval_toolkit-1.4.0}/tests/test_sql_analysis.py +0 -0
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: text2sql-eval-toolkit
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.4.0
|
|
4
4
|
Summary: A toolkit for evaluating text-to-SQL pipelines
|
|
5
5
|
Author-email: Oktie Hassanzadeh <lastname@us.ibm.com>
|
|
6
6
|
License: MIT
|
|
7
7
|
Project-URL: Homepage, https://github.com/IBM/text2sql-eval-toolkit
|
|
8
|
+
Project-URL: Documentation, https://text2sql-eval-toolkit.readthedocs.io/
|
|
9
|
+
Project-URL: Repository, https://github.com/IBM/text2sql-eval-toolkit
|
|
10
|
+
Project-URL: Changelog, https://github.com/IBM/text2sql-eval-toolkit/blob/main/CHANGELOG.md
|
|
11
|
+
Project-URL: Issues, https://github.com/IBM/text2sql-eval-toolkit/issues
|
|
8
12
|
Classifier: Programming Language :: Python :: 3
|
|
9
13
|
Classifier: License :: OSI Approved :: MIT License
|
|
10
14
|
Classifier: Operating System :: OS Independent
|
|
@@ -16,7 +20,6 @@ Requires-Dist: pandas>=2.2.3
|
|
|
16
20
|
Requires-Dist: requests>=2.32.4
|
|
17
21
|
Requires-Dist: sqlalchemy>=2.0.41
|
|
18
22
|
Requires-Dist: sqlparse>=0.5.3
|
|
19
|
-
Requires-Dist: unitxt>=1.26.1
|
|
20
23
|
Requires-Dist: psycopg2-binary>=2.9.10
|
|
21
24
|
Requires-Dist: sqlglot>=27.0.0
|
|
22
25
|
Requires-Dist: asyncpg>=0.30.0
|
|
@@ -29,6 +32,14 @@ Requires-Dist: python-dotenv>=1.1.1
|
|
|
29
32
|
Requires-Dist: langgraph>=0.2.0
|
|
30
33
|
Requires-Dist: langchain-core>=0.3.0
|
|
31
34
|
Requires-Dist: openai>=1.0.0
|
|
35
|
+
Requires-Dist: google-genai>=1.0.0
|
|
36
|
+
Requires-Dist: huggingface_hub<1.0,>=0.30
|
|
37
|
+
Provides-Extra: litellm
|
|
38
|
+
Requires-Dist: litellm>=1.50; extra == "litellm"
|
|
39
|
+
Provides-Extra: docs
|
|
40
|
+
Requires-Dist: mkdocs>=1.6; extra == "docs"
|
|
41
|
+
Requires-Dist: mkdocs-material>=9.5; extra == "docs"
|
|
42
|
+
Requires-Dist: mkdocstrings[python]>=0.26; extra == "docs"
|
|
32
43
|
Provides-Extra: db2
|
|
33
44
|
Requires-Dist: ibm-db>=3.2.6; extra == "db2"
|
|
34
45
|
Requires-Dist: ibm-db-sa>=0.4.0; extra == "db2"
|
|
@@ -44,6 +55,24 @@ Requires-Dist: presto-python-client>=0.8.4; extra == "presto"
|
|
|
44
55
|
Provides-Extra: notebook
|
|
45
56
|
Requires-Dist: jupyter>=1.0.0; extra == "notebook"
|
|
46
57
|
Requires-Dist: nbconvert>=7.0.0; extra == "notebook"
|
|
58
|
+
Provides-Extra: dashboard
|
|
59
|
+
Requires-Dist: fastapi>=0.115.0; extra == "dashboard"
|
|
60
|
+
Requires-Dist: uvicorn[standard]>=0.30.0; extra == "dashboard"
|
|
61
|
+
Requires-Dist: authlib>=1.3; extra == "dashboard"
|
|
62
|
+
Requires-Dist: itsdangerous>=2.1; extra == "dashboard"
|
|
63
|
+
Requires-Dist: pymysql>=1.1.1; extra == "dashboard"
|
|
64
|
+
Requires-Dist: aiomysql>=0.2.0; extra == "dashboard"
|
|
65
|
+
Requires-Dist: greenlet>=3.0.0; extra == "dashboard"
|
|
66
|
+
Requires-Dist: cryptography>=45.0.6; extra == "dashboard"
|
|
67
|
+
Provides-Extra: dev
|
|
68
|
+
Requires-Dist: pytest>=8.0.0; extra == "dev"
|
|
69
|
+
Requires-Dist: pytest-cov>=5.0.0; extra == "dev"
|
|
70
|
+
Requires-Dist: pytest-asyncio>=0.24.0; extra == "dev"
|
|
71
|
+
Requires-Dist: ruff>=0.6.0; extra == "dev"
|
|
72
|
+
Requires-Dist: black>=24.0.0; extra == "dev"
|
|
73
|
+
Requires-Dist: mypy>=1.11.0; extra == "dev"
|
|
74
|
+
Requires-Dist: types-PyYAML>=6.0; extra == "dev"
|
|
75
|
+
Requires-Dist: types-requests>=2.32; extra == "dev"
|
|
47
76
|
Dynamic: license-file
|
|
48
77
|
|
|
49
78
|
# Text-to-SQL Evaluation Toolkit
|
|
@@ -51,6 +80,10 @@ Dynamic: license-file
|
|
|
51
80
|
> **A modular framework for evaluating natural language to SQL systems**
|
|
52
81
|
> Supports execution-based metrics, multiple ground truths, LLM-as-judge, and rich error analysis.
|
|
53
82
|
|
|
83
|
+
<p align="center">
|
|
84
|
+
<img src="https://raw.githubusercontent.com/IBM/text2sql-eval-toolkit/main/dashboard-screenshot.png" alt="Text2SQL Evaluation Dashboard: benchmark overview with tiles for each dataset" width="560"/>
|
|
85
|
+
</p>
|
|
86
|
+
|
|
54
87
|
Text-to-SQL systems aim to translate natural language questions into executable SQL queries, enabling intuitive access to structured data. While recent advances in large language models have significantly improved generation quality, evaluating these systems remains a complex and critical challenge.
|
|
55
88
|
|
|
56
89
|
*Why an Evaluation Toolkit?*
|
|
@@ -76,17 +109,33 @@ Assessing the correctness and utility of generated SQL queries requires more tha
|
|
|
76
109
|
|
|
77
110
|
Whether you're building new models, comparing existing ones, or diagnosing performance bottlenecks, this toolkit provides the resources needed to evaluate text-to-SQL systems with rigor and clarity.
|
|
78
111
|
|
|
112
|
+
## Documentation
|
|
113
|
+
|
|
114
|
+
- **[Documentation site](https://text2sql-eval-toolkit.readthedocs.io/)** — the
|
|
115
|
+
guide (installation, the five stages, the data model, benchmarks, models,
|
|
116
|
+
LLM-as-judge, the CLI and configuration) and the
|
|
117
|
+
[API reference](https://text2sql-eval-toolkit.readthedocs.io/en/latest/reference/) for
|
|
118
|
+
every exported function and class.
|
|
119
|
+
- **[docs/dashboard/](https://github.com/IBM/text2sql-eval-toolkit/tree/main/docs/dashboard)** — the evaluation dashboard: features,
|
|
120
|
+
shareable links, the query index, capability tiers, and deployment.
|
|
121
|
+
- **[data/benchmarks/README.md](https://github.com/IBM/text2sql-eval-toolkit/blob/main/data/benchmarks/README.md)** — benchmark
|
|
122
|
+
definitions and configuration.
|
|
123
|
+
- **[data/benchmarks/dbs/README.md](https://github.com/IBM/text2sql-eval-toolkit/blob/main/data/benchmarks/dbs/README.md)** — database
|
|
124
|
+
setup for each benchmark.
|
|
125
|
+
- **[CONTRIBUTING.md](https://github.com/IBM/text2sql-eval-toolkit/blob/main/CONTRIBUTING.md)** — toolchain, tests, and coding standards.
|
|
126
|
+
|
|
79
127
|
## Components
|
|
80
128
|
|
|
81
129
|
<p align="center">
|
|
82
|
-
<img src="toolkit.png" alt="Text-to-SQL Toolkit Components" width="500"/>
|
|
130
|
+
<img src="https://raw.githubusercontent.com/IBM/text2sql-eval-toolkit/main/toolkit.png" alt="Text-to-SQL Toolkit Components" width="500"/>
|
|
83
131
|
</p>
|
|
84
132
|
|
|
85
|
-
- **Evaluation** ([`scripts/evaluation`](scripts/evaluation)/`src/evaluation.py`): Includes a script and library for evaluating text-to-SQL model outputs using various metrics. See [`scripts/evaluation/README.md`](scripts/evaluation/README.md) for details.
|
|
86
|
-
- **Text-to-SQL Inference** ([`scripts/inference`](scripts/inference)): Provides a simple LLM inference pipeline for generating SQL queries from natural language inputs. Run `python scripts/inference/run_inference.py -h` for more information.
|
|
87
|
-
- **SQL Execution** ([`scripts/execution`](scripts/execution)): Runs the ground truth and predicted SQLs for a given benchmark and saves the dataframes for evaluation and error analysis. Run `python scripts/execution/run_execution.py -h` for more information.
|
|
88
|
-
- **Results and Error Analysis** ([`scripts/analysis`](
|
|
89
|
-
- **SQL Profiling** ([`scripts/profiling`](
|
|
133
|
+
- **Evaluation** ([`scripts/evaluation`](https://github.com/IBM/text2sql-eval-toolkit/tree/main/scripts/evaluation)/`src/evaluation.py`): Includes a script and library for evaluating text-to-SQL model outputs using various metrics. See [`scripts/evaluation/README.md`](https://github.com/IBM/text2sql-eval-toolkit/blob/main/scripts/evaluation/README.md) for details.
|
|
134
|
+
- **Text-to-SQL Inference** ([`scripts/inference`](https://github.com/IBM/text2sql-eval-toolkit/tree/main/scripts/inference)): Provides a simple LLM inference pipeline for generating SQL queries from natural language inputs. Run `python scripts/inference/run_inference.py -h` for more information.
|
|
135
|
+
- **SQL Execution** ([`scripts/execution`](https://github.com/IBM/text2sql-eval-toolkit/tree/main/scripts/execution)): Runs the ground truth and predicted SQLs for a given benchmark and saves the dataframes for evaluation and error analysis. Run `python scripts/execution/run_execution.py -h` for more information.
|
|
136
|
+
- **Results and Error Analysis** ([`scripts/analysis`](https://github.com/IBM/text2sql-eval-toolkit/tree/main/scripts/analysis)): Contains scripts and utilities for analyzing evaluation results, identifying common error patterns, and generating summary statistics and visualizations. Useful for debugging and improving model performance.
|
|
137
|
+
- **SQL Profiling** ([`scripts/profiling`](https://github.com/IBM/text2sql-eval-toolkit/tree/main/scripts/profiling)) tools to profile SQL queries to gather query characteristics to facilitate better analysis of results and errors.
|
|
138
|
+
- **Evaluation Dashboard** ([`dashboard`](https://github.com/IBM/text2sql-eval-toolkit/tree/main/dashboard)): Optional FastAPI + React web UI for browsing benchmarks and pipeline metrics, error analysis (search, filters, cross-pipeline disagreement), side-by-side comparison of result summaries, editing LLM-as-judge YAML, and launching evaluations with job status. See [docs/dashboard/](https://github.com/IBM/text2sql-eval-toolkit/tree/main/docs/dashboard) for features, deployment, and development.
|
|
90
139
|
|
|
91
140
|
## Setup
|
|
92
141
|
|
|
@@ -110,6 +159,32 @@ pip install uv
|
|
|
110
159
|
brew install uv
|
|
111
160
|
```
|
|
112
161
|
|
|
162
|
+
## Pre-computed results
|
|
163
|
+
|
|
164
|
+
Zero-shot and agentic baseline results for all packaged benchmarks are
|
|
165
|
+
hosted on the [Hugging Face Hub](https://huggingface.co/datasets/text2sql-eval-toolkit/text2sql-eval-results).
|
|
166
|
+
To download them (~4 GB) into `${TEXT2SQL_DATA_ROOT:-./data}/results/`:
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
text2sql-eval-toolkit results fetch
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
After this completes, the dashboard and analysis scripts will work
|
|
173
|
+
against the downloaded artefacts. See [docs/dashboard/](https://github.com/IBM/text2sql-eval-toolkit/tree/main/docs/dashboard) to launch
|
|
174
|
+
the UI.
|
|
175
|
+
|
|
176
|
+
To fetch only a specific benchmark:
|
|
177
|
+
|
|
178
|
+
```bash
|
|
179
|
+
text2sql-eval-toolkit results fetch --benchmarks bird_mini_dev_sqlite
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
To list what is available without downloading:
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
text2sql-eval-toolkit results list
|
|
186
|
+
```
|
|
187
|
+
|
|
113
188
|
## Installation
|
|
114
189
|
|
|
115
190
|
### From PyPI
|
|
@@ -156,13 +231,13 @@ pip install -e .
|
|
|
156
231
|
|
|
157
232
|
## Additional Requirements
|
|
158
233
|
|
|
159
|
-
To use features that rely on LLM inference, you need to set the required environment variables for the relevant services. For watsonx.ai, this includes setting the following environment variables: `WATSONX_APIKEY`, `WATSONX_API_BASE`, and `WATSONX_PROJECTID`. See [env.example](env.example) for all available configuration options.
|
|
234
|
+
To use features that rely on LLM inference, you need to set the required environment variables for the relevant services. For watsonx.ai, this includes setting the following environment variables: `WATSONX_APIKEY`, `WATSONX_API_BASE`, and `WATSONX_PROJECTID`. See [env.example](https://github.com/IBM/text2sql-eval-toolkit/blob/main/env.example) for all available configuration options.
|
|
160
235
|
|
|
161
236
|
### Benchmarks
|
|
162
237
|
|
|
163
238
|
The toolkit comes with pre-defined public benchmarks including BIRD-SQL, Spider, Beaver, and Archer. These benchmarks require initial setup such as downloading databases or configuring connection strings. The toolkit also includes smaller test benchmarks (subsets of the full benchmarks) for quick validation and CI/CD pipelines.
|
|
164
239
|
|
|
165
|
-
**📚 See [data/benchmarks/README.md](data/benchmarks/README.md) for complete benchmark details, setup instructions, and configuration.**
|
|
240
|
+
**📚 See [data/benchmarks/README.md](https://github.com/IBM/text2sql-eval-toolkit/blob/main/data/benchmarks/README.md) for complete benchmark details, setup instructions, and configuration.**
|
|
166
241
|
|
|
167
242
|
## Usage
|
|
168
243
|
|
|
@@ -241,7 +316,7 @@ agentic.run_pipeline(
|
|
|
241
316
|
)
|
|
242
317
|
```
|
|
243
318
|
|
|
244
|
-
|
|
319
|
+
Every exported function and class is documented in the **[API reference](https://text2sql-eval-toolkit.readthedocs.io/en/latest/reference/)**, generated from the docstrings.
|
|
245
320
|
|
|
246
321
|
### Running Experiments
|
|
247
322
|
|
|
@@ -250,7 +325,7 @@ See the docstrings of the exported functions/classes in `text2sql_eval_toolkit._
|
|
|
250
325
|
python scripts/run_experiment.py [benchmark_name]
|
|
251
326
|
```
|
|
252
327
|
|
|
253
|
-
This will initialize a pipeline, perform inference to generate SQLs and output dataframes, and run the evaluation script to gather accuracy metrics. Benchmark names and configurations are defined in [`data/benchmarks.json`](data/benchmarks.json) (for full benchmarks) or [`data/test-benchmarks.json`](data/test-benchmarks.json) (for test benchmarks). See [data/benchmarks/README.md](data/benchmarks/README.md) for more details. Run `python scripts/run_experiment.py -h` for details on how to set different input arguments for the script.
|
|
328
|
+
This will initialize a pipeline, perform inference to generate SQLs and output dataframes, and run the evaluation script to gather accuracy metrics. Benchmark names and configurations are defined in [`data/benchmarks.json`](https://github.com/IBM/text2sql-eval-toolkit/blob/main/data/benchmarks.json) (for full benchmarks) or [`data/test-benchmarks.json`](https://github.com/IBM/text2sql-eval-toolkit/blob/main/data/test-benchmarks.json) (for test benchmarks). See [data/benchmarks/README.md](https://github.com/IBM/text2sql-eval-toolkit/blob/main/data/benchmarks/README.md) for more details. Run `python scripts/run_experiment.py -h` for details on how to set different input arguments for the script.
|
|
254
329
|
|
|
255
330
|
**Multiple Benchmarks:**
|
|
256
331
|
```bash
|
|
@@ -264,7 +339,7 @@ python scripts/run_all_benchmarks.py
|
|
|
264
339
|
python scripts/run_all_benchmarks.py --test --run_all_baselines
|
|
265
340
|
```
|
|
266
341
|
|
|
267
|
-
The `run_all_benchmarks.py` script supports separate model configurations for standard and agentic baselines to optimize runtime. See [data/benchmarks/README.md](data/benchmarks/README.md#model-configuration) for detailed configuration options.
|
|
342
|
+
The `run_all_benchmarks.py` script supports separate model configurations for standard and agentic baselines to optimize runtime. See [data/benchmarks/README.md](https://github.com/IBM/text2sql-eval-toolkit/blob/main/data/benchmarks/README.md#model-configuration) for detailed configuration options.
|
|
268
343
|
|
|
269
344
|
### Running Individual Components
|
|
270
345
|
|
|
@@ -274,7 +349,7 @@ To run evaluation only:
|
|
|
274
349
|
python scripts/evaluation/run_evaluation.py [-h] [--output_file OUTPUT_FILE] [--summary_file SUMMARY_FILE] [--csv_summary_file CSV_SUMMARY_FILE] [--use_llm_judge] input_file
|
|
275
350
|
```
|
|
276
351
|
|
|
277
|
-
See [`scripts/evaluation/README.md`](scripts/evaluation/README.md) for details.
|
|
352
|
+
See [`scripts/evaluation/README.md`](https://github.com/IBM/text2sql-eval-toolkit/blob/main/scripts/evaluation/README.md) for details.
|
|
278
353
|
|
|
279
354
|
To run inference only:
|
|
280
355
|
|
|
@@ -311,12 +386,33 @@ To produce the results dashboard along with results summary and error analysis M
|
|
|
311
386
|
python scripts/analysis/make_summary_report.py
|
|
312
387
|
```
|
|
313
388
|
|
|
314
|
-
The output will be written to [data/results/README.md](data/results/README.md).
|
|
389
|
+
The output will be written to [data/results/README.md](https://github.com/IBM/text2sql-eval-toolkit/blob/main/data/results/README.md).
|
|
390
|
+
|
|
391
|
+
### Evaluation dashboard
|
|
392
|
+
|
|
393
|
+
A web UI for browsing results, comparing pipelines and doing error analysis:
|
|
394
|
+
|
|
395
|
+
```bash
|
|
396
|
+
uv pip install -e ".[dashboard]"
|
|
397
|
+
text2sql-eval-dashboard --open-browser
|
|
398
|
+
```
|
|
399
|
+
|
|
400
|
+
Every view has its own URL, so a benchmark, pipeline, filtered query or
|
|
401
|
+
individual record can be linked to directly.
|
|
402
|
+
|
|
403
|
+
The dashboard runs as a local tool with every capability enabled, or as a
|
|
404
|
+
shared read-only site with optional sign-in for a small allowlist. See
|
|
405
|
+
**[docs/dashboard/](https://github.com/IBM/text2sql-eval-toolkit/tree/main/docs/dashboard)** for features, the URL scheme, the query
|
|
406
|
+
index, capability tiers, and deployment.
|
|
315
407
|
|
|
316
408
|
## Project Structure
|
|
317
409
|
|
|
318
410
|
```
|
|
319
411
|
text2sql-eval-toolkit
|
|
412
|
+
├── docs/ # Dashboard guides, deployment, development history
|
|
413
|
+
├── deploy/ # Container, Compose stack, and data provisioning
|
|
414
|
+
├── dashboard/ # React frontend (production build committed to dist/)
|
|
415
|
+
├── tests/ # Test suite
|
|
320
416
|
├── notebooks/ # Jupyter notebooks showcasing the use of the toolkit functions
|
|
321
417
|
├── data/ # Benchmark datasets and evaluation results
|
|
322
418
|
│ ├── benchmarks/ # Benchmark data and schema files
|
|
@@ -340,10 +436,12 @@ text2sql-eval-toolkit
|
|
|
340
436
|
│ ├── evaluation/ # Evaluation module
|
|
341
437
|
│ ├── execution/ # SQL execution module
|
|
342
438
|
│ ├── inference/ # LLM inference (baseline) module
|
|
343
|
-
│
|
|
439
|
+
│ ├── indexing/ # SQLite query index over the result artifacts
|
|
440
|
+
│ ├── profiling/ # SQL profiling module
|
|
441
|
+
│ └── ui/ # Dashboard backend (FastAPI)
|
|
344
442
|
├── pyproject.toml # Build system and project metadata
|
|
345
443
|
├── README.md # Project documentation
|
|
346
|
-
├── requirements.txt #
|
|
444
|
+
├── requirements.txt # Pinned export of uv.lock (generated; see its header)
|
|
347
445
|
└── LICENSE # License file
|
|
348
446
|
|
|
349
447
|
```
|
|
@@ -358,7 +456,7 @@ A good way to familiarize yourself with the codebase and contribution process is
|
|
|
358
456
|
|
|
359
457
|
**Note: We appreciate your effort, and want to avoid a situation where a contribution requires extensive rework (by you or by us), sits in backlog for a long time, or cannot be accepted at all!**
|
|
360
458
|
|
|
361
|
-
For detailed contribution guidelines, please see [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
459
|
+
For detailed contribution guidelines, please see [CONTRIBUTING.md](https://github.com/IBM/text2sql-eval-toolkit/blob/main/CONTRIBUTING.md).
|
|
362
460
|
|
|
363
461
|
### Pull Request Process
|
|
364
462
|
|
|
@@ -370,13 +468,31 @@ For detailed contribution guidelines, please see [CONTRIBUTING.md](CONTRIBUTING.
|
|
|
370
468
|
|
|
371
469
|
## License
|
|
372
470
|
|
|
373
|
-
This project is licensed under the Apache License 2.0. See the [LICENSE](LICENSE) file for more details.
|
|
471
|
+
This project is licensed under the Apache License 2.0. See the [LICENSE](https://github.com/IBM/text2sql-eval-toolkit/tree/main/LICENSE) file for more details.
|
|
472
|
+
|
|
473
|
+
## Citation
|
|
474
|
+
|
|
475
|
+
If you use this toolkit in research, please cite:
|
|
476
|
+
|
|
477
|
+
```bibtex
|
|
478
|
+
@article{HassanzadehPPKZVGSPR26,
|
|
479
|
+
title = {Text-to-{SQL} Evaluation Toolkit},
|
|
480
|
+
volume = {19},
|
|
481
|
+
url = {https://doi.org/10.14778/3827998.3828071},
|
|
482
|
+
doi = {10.14778/3827998.3828071},
|
|
483
|
+
number = {12},
|
|
484
|
+
journal = {Proc. VLDB Endow.},
|
|
485
|
+
author = {Hassanzadeh, Oktie and Perlitz, Yotam and Pham, Nhan and Kaple, Tanvi and \.{Z}r\'{o}bek, Karolina and Vu, Long and Glass, Michael and Subramanian, Dharmashankar and Pourreza, Mohammadreza and Rafiei, Davood},
|
|
486
|
+
year = {2026},
|
|
487
|
+
pages = {4582--4585},
|
|
488
|
+
}
|
|
489
|
+
```
|
|
374
490
|
|
|
375
491
|
## Additional Resources
|
|
376
492
|
|
|
377
|
-
- [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) - Community guidelines
|
|
378
|
-
- [SECURITY.md](SECURITY.md) - Security policy and vulnerability reporting
|
|
379
|
-
- [MAINTAINERS.md](MAINTAINERS.md) - Project maintainers
|
|
380
|
-
- [CHANGELOG.md](CHANGELOG.md) - Project changelog
|
|
493
|
+
- [CODE_OF_CONDUCT.md](https://github.com/IBM/text2sql-eval-toolkit/blob/main/CODE_OF_CONDUCT.md) - Community guidelines
|
|
494
|
+
- [SECURITY.md](https://github.com/IBM/text2sql-eval-toolkit/blob/main/SECURITY.md) - Security policy and vulnerability reporting
|
|
495
|
+
- [MAINTAINERS.md](https://github.com/IBM/text2sql-eval-toolkit/blob/main/MAINTAINERS.md) - Project maintainers
|
|
496
|
+
- [CHANGELOG.md](https://github.com/IBM/text2sql-eval-toolkit/blob/main/CHANGELOG.md) - Project changelog
|
|
381
497
|
|
|
382
498
|
[issues]: https://github.com/IBM/text2sql-eval-toolkit/issues/new
|
|
@@ -1,56 +1,12 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: text2sql-eval-toolkit
|
|
3
|
-
Version: 1.0.0
|
|
4
|
-
Summary: A toolkit for evaluating text-to-SQL pipelines
|
|
5
|
-
Author-email: Oktie Hassanzadeh <lastname@us.ibm.com>
|
|
6
|
-
License: MIT
|
|
7
|
-
Project-URL: Homepage, https://github.com/IBM/text2sql-eval-toolkit
|
|
8
|
-
Classifier: Programming Language :: Python :: 3
|
|
9
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
-
Classifier: Operating System :: OS Independent
|
|
11
|
-
Requires-Python: >=3.11
|
|
12
|
-
Description-Content-Type: text/markdown
|
|
13
|
-
License-File: LICENSE
|
|
14
|
-
Requires-Dist: ibm_watsonx_ai>=1.3.30
|
|
15
|
-
Requires-Dist: pandas>=2.2.3
|
|
16
|
-
Requires-Dist: requests>=2.32.4
|
|
17
|
-
Requires-Dist: sqlalchemy>=2.0.41
|
|
18
|
-
Requires-Dist: sqlparse>=0.5.3
|
|
19
|
-
Requires-Dist: unitxt>=1.26.1
|
|
20
|
-
Requires-Dist: psycopg2-binary>=2.9.10
|
|
21
|
-
Requires-Dist: sqlglot>=27.0.0
|
|
22
|
-
Requires-Dist: asyncpg>=0.30.0
|
|
23
|
-
Requires-Dist: setuptools>=77.0.3
|
|
24
|
-
Requires-Dist: loguru>=0.7.3
|
|
25
|
-
Requires-Dist: func-timeout>=4.3.5
|
|
26
|
-
Requires-Dist: tqdm>=4.67.1
|
|
27
|
-
Requires-Dist: matplotlib>=3.10.5
|
|
28
|
-
Requires-Dist: python-dotenv>=1.1.1
|
|
29
|
-
Requires-Dist: langgraph>=0.2.0
|
|
30
|
-
Requires-Dist: langchain-core>=0.3.0
|
|
31
|
-
Requires-Dist: openai>=1.0.0
|
|
32
|
-
Provides-Extra: db2
|
|
33
|
-
Requires-Dist: ibm-db>=3.2.6; extra == "db2"
|
|
34
|
-
Requires-Dist: ibm-db-sa>=0.4.0; extra == "db2"
|
|
35
|
-
Requires-Dist: sqlalchemy>=2.0; extra == "db2"
|
|
36
|
-
Provides-Extra: mysql
|
|
37
|
-
Requires-Dist: pymysql>=1.1.1; extra == "mysql"
|
|
38
|
-
Requires-Dist: aiomysql>=0.2.0; extra == "mysql"
|
|
39
|
-
Requires-Dist: greenlet>=3.0.0; extra == "mysql"
|
|
40
|
-
Requires-Dist: cryptography>=45.0.6; extra == "mysql"
|
|
41
|
-
Provides-Extra: presto
|
|
42
|
-
Requires-Dist: pyhive>=0.7.0; extra == "presto"
|
|
43
|
-
Requires-Dist: presto-python-client>=0.8.4; extra == "presto"
|
|
44
|
-
Provides-Extra: notebook
|
|
45
|
-
Requires-Dist: jupyter>=1.0.0; extra == "notebook"
|
|
46
|
-
Requires-Dist: nbconvert>=7.0.0; extra == "notebook"
|
|
47
|
-
Dynamic: license-file
|
|
48
|
-
|
|
49
1
|
# Text-to-SQL Evaluation Toolkit
|
|
50
2
|
|
|
51
3
|
> **A modular framework for evaluating natural language to SQL systems**
|
|
52
4
|
> Supports execution-based metrics, multiple ground truths, LLM-as-judge, and rich error analysis.
|
|
53
5
|
|
|
6
|
+
<p align="center">
|
|
7
|
+
<img src="https://raw.githubusercontent.com/IBM/text2sql-eval-toolkit/main/dashboard-screenshot.png" alt="Text2SQL Evaluation Dashboard: benchmark overview with tiles for each dataset" width="560"/>
|
|
8
|
+
</p>
|
|
9
|
+
|
|
54
10
|
Text-to-SQL systems aim to translate natural language questions into executable SQL queries, enabling intuitive access to structured data. While recent advances in large language models have significantly improved generation quality, evaluating these systems remains a complex and critical challenge.
|
|
55
11
|
|
|
56
12
|
*Why an Evaluation Toolkit?*
|
|
@@ -76,17 +32,33 @@ Assessing the correctness and utility of generated SQL queries requires more tha
|
|
|
76
32
|
|
|
77
33
|
Whether you're building new models, comparing existing ones, or diagnosing performance bottlenecks, this toolkit provides the resources needed to evaluate text-to-SQL systems with rigor and clarity.
|
|
78
34
|
|
|
35
|
+
## Documentation
|
|
36
|
+
|
|
37
|
+
- **[Documentation site](https://text2sql-eval-toolkit.readthedocs.io/)** — the
|
|
38
|
+
guide (installation, the five stages, the data model, benchmarks, models,
|
|
39
|
+
LLM-as-judge, the CLI and configuration) and the
|
|
40
|
+
[API reference](https://text2sql-eval-toolkit.readthedocs.io/en/latest/reference/) for
|
|
41
|
+
every exported function and class.
|
|
42
|
+
- **[docs/dashboard/](https://github.com/IBM/text2sql-eval-toolkit/tree/main/docs/dashboard)** — the evaluation dashboard: features,
|
|
43
|
+
shareable links, the query index, capability tiers, and deployment.
|
|
44
|
+
- **[data/benchmarks/README.md](https://github.com/IBM/text2sql-eval-toolkit/blob/main/data/benchmarks/README.md)** — benchmark
|
|
45
|
+
definitions and configuration.
|
|
46
|
+
- **[data/benchmarks/dbs/README.md](https://github.com/IBM/text2sql-eval-toolkit/blob/main/data/benchmarks/dbs/README.md)** — database
|
|
47
|
+
setup for each benchmark.
|
|
48
|
+
- **[CONTRIBUTING.md](https://github.com/IBM/text2sql-eval-toolkit/blob/main/CONTRIBUTING.md)** — toolchain, tests, and coding standards.
|
|
49
|
+
|
|
79
50
|
## Components
|
|
80
51
|
|
|
81
52
|
<p align="center">
|
|
82
|
-
<img src="toolkit.png" alt="Text-to-SQL Toolkit Components" width="500"/>
|
|
53
|
+
<img src="https://raw.githubusercontent.com/IBM/text2sql-eval-toolkit/main/toolkit.png" alt="Text-to-SQL Toolkit Components" width="500"/>
|
|
83
54
|
</p>
|
|
84
55
|
|
|
85
|
-
- **Evaluation** ([`scripts/evaluation`](scripts/evaluation)/`src/evaluation.py`): Includes a script and library for evaluating text-to-SQL model outputs using various metrics. See [`scripts/evaluation/README.md`](scripts/evaluation/README.md) for details.
|
|
86
|
-
- **Text-to-SQL Inference** ([`scripts/inference`](scripts/inference)): Provides a simple LLM inference pipeline for generating SQL queries from natural language inputs. Run `python scripts/inference/run_inference.py -h` for more information.
|
|
87
|
-
- **SQL Execution** ([`scripts/execution`](scripts/execution)): Runs the ground truth and predicted SQLs for a given benchmark and saves the dataframes for evaluation and error analysis. Run `python scripts/execution/run_execution.py -h` for more information.
|
|
88
|
-
- **Results and Error Analysis** ([`scripts/analysis`](
|
|
89
|
-
- **SQL Profiling** ([`scripts/profiling`](
|
|
56
|
+
- **Evaluation** ([`scripts/evaluation`](https://github.com/IBM/text2sql-eval-toolkit/tree/main/scripts/evaluation)/`src/evaluation.py`): Includes a script and library for evaluating text-to-SQL model outputs using various metrics. See [`scripts/evaluation/README.md`](https://github.com/IBM/text2sql-eval-toolkit/blob/main/scripts/evaluation/README.md) for details.
|
|
57
|
+
- **Text-to-SQL Inference** ([`scripts/inference`](https://github.com/IBM/text2sql-eval-toolkit/tree/main/scripts/inference)): Provides a simple LLM inference pipeline for generating SQL queries from natural language inputs. Run `python scripts/inference/run_inference.py -h` for more information.
|
|
58
|
+
- **SQL Execution** ([`scripts/execution`](https://github.com/IBM/text2sql-eval-toolkit/tree/main/scripts/execution)): Runs the ground truth and predicted SQLs for a given benchmark and saves the dataframes for evaluation and error analysis. Run `python scripts/execution/run_execution.py -h` for more information.
|
|
59
|
+
- **Results and Error Analysis** ([`scripts/analysis`](https://github.com/IBM/text2sql-eval-toolkit/tree/main/scripts/analysis)): Contains scripts and utilities for analyzing evaluation results, identifying common error patterns, and generating summary statistics and visualizations. Useful for debugging and improving model performance.
|
|
60
|
+
- **SQL Profiling** ([`scripts/profiling`](https://github.com/IBM/text2sql-eval-toolkit/tree/main/scripts/profiling)) tools to profile SQL queries to gather query characteristics to facilitate better analysis of results and errors.
|
|
61
|
+
- **Evaluation Dashboard** ([`dashboard`](https://github.com/IBM/text2sql-eval-toolkit/tree/main/dashboard)): Optional FastAPI + React web UI for browsing benchmarks and pipeline metrics, error analysis (search, filters, cross-pipeline disagreement), side-by-side comparison of result summaries, editing LLM-as-judge YAML, and launching evaluations with job status. See [docs/dashboard/](https://github.com/IBM/text2sql-eval-toolkit/tree/main/docs/dashboard) for features, deployment, and development.
|
|
90
62
|
|
|
91
63
|
## Setup
|
|
92
64
|
|
|
@@ -110,6 +82,32 @@ pip install uv
|
|
|
110
82
|
brew install uv
|
|
111
83
|
```
|
|
112
84
|
|
|
85
|
+
## Pre-computed results
|
|
86
|
+
|
|
87
|
+
Zero-shot and agentic baseline results for all packaged benchmarks are
|
|
88
|
+
hosted on the [Hugging Face Hub](https://huggingface.co/datasets/text2sql-eval-toolkit/text2sql-eval-results).
|
|
89
|
+
To download them (~4 GB) into `${TEXT2SQL_DATA_ROOT:-./data}/results/`:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
text2sql-eval-toolkit results fetch
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
After this completes, the dashboard and analysis scripts will work
|
|
96
|
+
against the downloaded artefacts. See [docs/dashboard/](https://github.com/IBM/text2sql-eval-toolkit/tree/main/docs/dashboard) to launch
|
|
97
|
+
the UI.
|
|
98
|
+
|
|
99
|
+
To fetch only a specific benchmark:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
text2sql-eval-toolkit results fetch --benchmarks bird_mini_dev_sqlite
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
To list what is available without downloading:
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
text2sql-eval-toolkit results list
|
|
109
|
+
```
|
|
110
|
+
|
|
113
111
|
## Installation
|
|
114
112
|
|
|
115
113
|
### From PyPI
|
|
@@ -156,13 +154,13 @@ pip install -e .
|
|
|
156
154
|
|
|
157
155
|
## Additional Requirements
|
|
158
156
|
|
|
159
|
-
To use features that rely on LLM inference, you need to set the required environment variables for the relevant services. For watsonx.ai, this includes setting the following environment variables: `WATSONX_APIKEY`, `WATSONX_API_BASE`, and `WATSONX_PROJECTID`. See [env.example](env.example) for all available configuration options.
|
|
157
|
+
To use features that rely on LLM inference, you need to set the required environment variables for the relevant services. For watsonx.ai, this includes setting the following environment variables: `WATSONX_APIKEY`, `WATSONX_API_BASE`, and `WATSONX_PROJECTID`. See [env.example](https://github.com/IBM/text2sql-eval-toolkit/blob/main/env.example) for all available configuration options.
|
|
160
158
|
|
|
161
159
|
### Benchmarks
|
|
162
160
|
|
|
163
161
|
The toolkit comes with pre-defined public benchmarks including BIRD-SQL, Spider, Beaver, and Archer. These benchmarks require initial setup such as downloading databases or configuring connection strings. The toolkit also includes smaller test benchmarks (subsets of the full benchmarks) for quick validation and CI/CD pipelines.
|
|
164
162
|
|
|
165
|
-
**📚 See [data/benchmarks/README.md](data/benchmarks/README.md) for complete benchmark details, setup instructions, and configuration.**
|
|
163
|
+
**📚 See [data/benchmarks/README.md](https://github.com/IBM/text2sql-eval-toolkit/blob/main/data/benchmarks/README.md) for complete benchmark details, setup instructions, and configuration.**
|
|
166
164
|
|
|
167
165
|
## Usage
|
|
168
166
|
|
|
@@ -241,7 +239,7 @@ agentic.run_pipeline(
|
|
|
241
239
|
)
|
|
242
240
|
```
|
|
243
241
|
|
|
244
|
-
|
|
242
|
+
Every exported function and class is documented in the **[API reference](https://text2sql-eval-toolkit.readthedocs.io/en/latest/reference/)**, generated from the docstrings.
|
|
245
243
|
|
|
246
244
|
### Running Experiments
|
|
247
245
|
|
|
@@ -250,7 +248,7 @@ See the docstrings of the exported functions/classes in `text2sql_eval_toolkit._
|
|
|
250
248
|
python scripts/run_experiment.py [benchmark_name]
|
|
251
249
|
```
|
|
252
250
|
|
|
253
|
-
This will initialize a pipeline, perform inference to generate SQLs and output dataframes, and run the evaluation script to gather accuracy metrics. Benchmark names and configurations are defined in [`data/benchmarks.json`](data/benchmarks.json) (for full benchmarks) or [`data/test-benchmarks.json`](data/test-benchmarks.json) (for test benchmarks). See [data/benchmarks/README.md](data/benchmarks/README.md) for more details. Run `python scripts/run_experiment.py -h` for details on how to set different input arguments for the script.
|
|
251
|
+
This will initialize a pipeline, perform inference to generate SQLs and output dataframes, and run the evaluation script to gather accuracy metrics. Benchmark names and configurations are defined in [`data/benchmarks.json`](https://github.com/IBM/text2sql-eval-toolkit/blob/main/data/benchmarks.json) (for full benchmarks) or [`data/test-benchmarks.json`](https://github.com/IBM/text2sql-eval-toolkit/blob/main/data/test-benchmarks.json) (for test benchmarks). See [data/benchmarks/README.md](https://github.com/IBM/text2sql-eval-toolkit/blob/main/data/benchmarks/README.md) for more details. Run `python scripts/run_experiment.py -h` for details on how to set different input arguments for the script.
|
|
254
252
|
|
|
255
253
|
**Multiple Benchmarks:**
|
|
256
254
|
```bash
|
|
@@ -264,7 +262,7 @@ python scripts/run_all_benchmarks.py
|
|
|
264
262
|
python scripts/run_all_benchmarks.py --test --run_all_baselines
|
|
265
263
|
```
|
|
266
264
|
|
|
267
|
-
The `run_all_benchmarks.py` script supports separate model configurations for standard and agentic baselines to optimize runtime. See [data/benchmarks/README.md](data/benchmarks/README.md#model-configuration) for detailed configuration options.
|
|
265
|
+
The `run_all_benchmarks.py` script supports separate model configurations for standard and agentic baselines to optimize runtime. See [data/benchmarks/README.md](https://github.com/IBM/text2sql-eval-toolkit/blob/main/data/benchmarks/README.md#model-configuration) for detailed configuration options.
|
|
268
266
|
|
|
269
267
|
### Running Individual Components
|
|
270
268
|
|
|
@@ -274,7 +272,7 @@ To run evaluation only:
|
|
|
274
272
|
python scripts/evaluation/run_evaluation.py [-h] [--output_file OUTPUT_FILE] [--summary_file SUMMARY_FILE] [--csv_summary_file CSV_SUMMARY_FILE] [--use_llm_judge] input_file
|
|
275
273
|
```
|
|
276
274
|
|
|
277
|
-
See [`scripts/evaluation/README.md`](scripts/evaluation/README.md) for details.
|
|
275
|
+
See [`scripts/evaluation/README.md`](https://github.com/IBM/text2sql-eval-toolkit/blob/main/scripts/evaluation/README.md) for details.
|
|
278
276
|
|
|
279
277
|
To run inference only:
|
|
280
278
|
|
|
@@ -311,12 +309,33 @@ To produce the results dashboard along with results summary and error analysis M
|
|
|
311
309
|
python scripts/analysis/make_summary_report.py
|
|
312
310
|
```
|
|
313
311
|
|
|
314
|
-
The output will be written to [data/results/README.md](data/results/README.md).
|
|
312
|
+
The output will be written to [data/results/README.md](https://github.com/IBM/text2sql-eval-toolkit/blob/main/data/results/README.md).
|
|
313
|
+
|
|
314
|
+
### Evaluation dashboard
|
|
315
|
+
|
|
316
|
+
A web UI for browsing results, comparing pipelines and doing error analysis:
|
|
317
|
+
|
|
318
|
+
```bash
|
|
319
|
+
uv pip install -e ".[dashboard]"
|
|
320
|
+
text2sql-eval-dashboard --open-browser
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
Every view has its own URL, so a benchmark, pipeline, filtered query or
|
|
324
|
+
individual record can be linked to directly.
|
|
325
|
+
|
|
326
|
+
The dashboard runs as a local tool with every capability enabled, or as a
|
|
327
|
+
shared read-only site with optional sign-in for a small allowlist. See
|
|
328
|
+
**[docs/dashboard/](https://github.com/IBM/text2sql-eval-toolkit/tree/main/docs/dashboard)** for features, the URL scheme, the query
|
|
329
|
+
index, capability tiers, and deployment.
|
|
315
330
|
|
|
316
331
|
## Project Structure
|
|
317
332
|
|
|
318
333
|
```
|
|
319
334
|
text2sql-eval-toolkit
|
|
335
|
+
├── docs/ # Dashboard guides, deployment, development history
|
|
336
|
+
├── deploy/ # Container, Compose stack, and data provisioning
|
|
337
|
+
├── dashboard/ # React frontend (production build committed to dist/)
|
|
338
|
+
├── tests/ # Test suite
|
|
320
339
|
├── notebooks/ # Jupyter notebooks showcasing the use of the toolkit functions
|
|
321
340
|
├── data/ # Benchmark datasets and evaluation results
|
|
322
341
|
│ ├── benchmarks/ # Benchmark data and schema files
|
|
@@ -340,10 +359,12 @@ text2sql-eval-toolkit
|
|
|
340
359
|
│ ├── evaluation/ # Evaluation module
|
|
341
360
|
│ ├── execution/ # SQL execution module
|
|
342
361
|
│ ├── inference/ # LLM inference (baseline) module
|
|
343
|
-
│
|
|
362
|
+
│ ├── indexing/ # SQLite query index over the result artifacts
|
|
363
|
+
│ ├── profiling/ # SQL profiling module
|
|
364
|
+
│ └── ui/ # Dashboard backend (FastAPI)
|
|
344
365
|
├── pyproject.toml # Build system and project metadata
|
|
345
366
|
├── README.md # Project documentation
|
|
346
|
-
├── requirements.txt #
|
|
367
|
+
├── requirements.txt # Pinned export of uv.lock (generated; see its header)
|
|
347
368
|
└── LICENSE # License file
|
|
348
369
|
|
|
349
370
|
```
|
|
@@ -358,7 +379,7 @@ A good way to familiarize yourself with the codebase and contribution process is
|
|
|
358
379
|
|
|
359
380
|
**Note: We appreciate your effort, and want to avoid a situation where a contribution requires extensive rework (by you or by us), sits in backlog for a long time, or cannot be accepted at all!**
|
|
360
381
|
|
|
361
|
-
For detailed contribution guidelines, please see [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
382
|
+
For detailed contribution guidelines, please see [CONTRIBUTING.md](https://github.com/IBM/text2sql-eval-toolkit/blob/main/CONTRIBUTING.md).
|
|
362
383
|
|
|
363
384
|
### Pull Request Process
|
|
364
385
|
|
|
@@ -370,13 +391,31 @@ For detailed contribution guidelines, please see [CONTRIBUTING.md](CONTRIBUTING.
|
|
|
370
391
|
|
|
371
392
|
## License
|
|
372
393
|
|
|
373
|
-
This project is licensed under the Apache License 2.0. See the [LICENSE](LICENSE) file for more details.
|
|
394
|
+
This project is licensed under the Apache License 2.0. See the [LICENSE](https://github.com/IBM/text2sql-eval-toolkit/tree/main/LICENSE) file for more details.
|
|
395
|
+
|
|
396
|
+
## Citation
|
|
397
|
+
|
|
398
|
+
If you use this toolkit in research, please cite:
|
|
399
|
+
|
|
400
|
+
```bibtex
|
|
401
|
+
@article{HassanzadehPPKZVGSPR26,
|
|
402
|
+
title = {Text-to-{SQL} Evaluation Toolkit},
|
|
403
|
+
volume = {19},
|
|
404
|
+
url = {https://doi.org/10.14778/3827998.3828071},
|
|
405
|
+
doi = {10.14778/3827998.3828071},
|
|
406
|
+
number = {12},
|
|
407
|
+
journal = {Proc. VLDB Endow.},
|
|
408
|
+
author = {Hassanzadeh, Oktie and Perlitz, Yotam and Pham, Nhan and Kaple, Tanvi and \.{Z}r\'{o}bek, Karolina and Vu, Long and Glass, Michael and Subramanian, Dharmashankar and Pourreza, Mohammadreza and Rafiei, Davood},
|
|
409
|
+
year = {2026},
|
|
410
|
+
pages = {4582--4585},
|
|
411
|
+
}
|
|
412
|
+
```
|
|
374
413
|
|
|
375
414
|
## Additional Resources
|
|
376
415
|
|
|
377
|
-
- [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) - Community guidelines
|
|
378
|
-
- [SECURITY.md](SECURITY.md) - Security policy and vulnerability reporting
|
|
379
|
-
- [MAINTAINERS.md](MAINTAINERS.md) - Project maintainers
|
|
380
|
-
- [CHANGELOG.md](CHANGELOG.md) - Project changelog
|
|
416
|
+
- [CODE_OF_CONDUCT.md](https://github.com/IBM/text2sql-eval-toolkit/blob/main/CODE_OF_CONDUCT.md) - Community guidelines
|
|
417
|
+
- [SECURITY.md](https://github.com/IBM/text2sql-eval-toolkit/blob/main/SECURITY.md) - Security policy and vulnerability reporting
|
|
418
|
+
- [MAINTAINERS.md](https://github.com/IBM/text2sql-eval-toolkit/blob/main/MAINTAINERS.md) - Project maintainers
|
|
419
|
+
- [CHANGELOG.md](https://github.com/IBM/text2sql-eval-toolkit/blob/main/CHANGELOG.md) - Project changelog
|
|
381
420
|
|
|
382
421
|
[issues]: https://github.com/IBM/text2sql-eval-toolkit/issues/new
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{R as p,u as Ne,a as Be,r as l,b as Oe,F as Ke,c as We,d as ee,m as He,i as qe,_ as te,W as Ue,e as Ve,C as Qe,f as Xe,s as Ge,g as Je,h as Ye,A as Ze,P as i,j as ue,k as s,I as ve,l as et,D as tt,B as se,n as st,T as at,o as it,p as nt,q as je,t as rt,v as lt,w as ot,x as dt,y as ct,z as ut}from"./index-DLyduwv0.js";import{d as _e,u as $e,L as ae,a as mt,b as pt}from"./defaultItemToString-ClUBp4QC.js";const{ItemMouseMove:ht,MenuMouseLeave:ft,ToggleButtonBlur:gt,FunctionCloseMenu:bt}=$e.stateChangeTypes;function Ie(o,E){const{changes:h,type:S}=E;switch(S){case ht:return o;case ft:return h.highlightedIndex===o.highlightedIndex?o:h;case gt:case bt:return{...h,selectedItem:o.selectedItem};default:return h}}const ie=p.forwardRef(({autoAlign:o=!1,className:E,decorator:h,disabled:S=!1,direction:z="bottom",items:R,label:A,["aria-label"]:I,ariaLabel:Q,itemToString:b=_e,itemToElement:L=null,renderSelectedItem:N,type:X="default",size:D,onChange:y,id:F,titleText:B="",hideLabel:m,helperText:O="",translateWithId:M,light:K,invalid:G,invalidText:$,warn:ne,warnText:P,initialSelectedItem:W,selectedItem:H,downshiftProps:J,readOnly:w,slug:v,...re},Y)=>{const C=Ne("enable-v12-dynamic-floating-styles"),{refs:j,floatingStyles:q,middlewareData:le}=Be(C||o?{placement:z,strategy:"fixed",middleware:[Ge({apply({rects:a,elements:c}){Object.assign(c.floating.style,{width:`${a.reference.width}px`})}}),o&&Je(),o&&Ye()],whileElementsMounted:Xe}:{});l.useEffect(()=>{var a;if(C||o){const c={...q,visibility:(a=le.hide)!=null&&a.referenceHidden?"hidden":"visible"};Object.keys(c).forEach(_=>{j.floating.current&&(j.floating.current.style[_]=c[_])})}},[q,o,j.floating]);const e=Oe(),{isFluid:t}=l.useContext(Ke),n=l.useCallback(({selectedItem:a})=>{y&&y({selectedItem:a??null})},[y]),u=l.useCallback((a,c)=>a!==null&&typeof a=="object"&&"disabled"in a&&a.disabled===!0,[]),d=l.useCallback(a=>{const{highlightedIndex:c}=a;if(c!==void 0&&c>-1){const Z=document.querySelectorAll(`li.${e}--list-box__menu-item[role="option"]`)[c];Z&&Z.scrollIntoView({behavior:"smooth",block:"nearest"})}},[e]),f=l.useMemo(()=>R,[R]),k=l.useMemo(()=>({items:f,itemToString:b,initialSelectedItem:W,onSelectedItemChange:n,stateReducer:Ie,isItemDisabled:u,onHighlightedIndexChange:d,...J}),[f,b,W,n,Ie,u,d,J]);H!==void 0&&(k.selectedItem=H);const{isOpen:g,getToggleButtonProps:Ce,getLabelProps:ke,getMenuProps:me,getItemProps:Te,selectedItem:x,highlightedIndex:Ee}=$e(k),T=X==="inline",r=We({id:F,readOnly:w,disabled:S??!1,invalid:G??!1,invalidText:$,warn:ne??!1,warnText:P}),[Se,oe]=l.useState(!1),De=ee(`${e}--dropdown`,{[`${e}--dropdown--invalid`]:r.invalid,[`${e}--dropdown--warning`]:r.warn,[`${e}--dropdown--open`]:g,[`${e}--dropdown--focus`]:Se,[`${e}--dropdown--inline`]:T,[`${e}--dropdown--disabled`]:r.disabled,[`${e}--dropdown--light`]:K,[`${e}--dropdown--readonly`]:w,[`${e}--dropdown--${D}`]:D,[`${e}--list-box--up`]:z==="top",[`${e}--autoalign`]:o}),Fe=ee(`${e}--label`,{[`${e}--label--disabled`]:r.disabled,[`${e}--visually-hidden`]:m}),Me=ee(`${e}--form__helper-text`,{[`${e}--form__helper-text--disabled`]:r.disabled}),Pe=ee(`${e}--dropdown__wrapper`,`${e}--list-box__wrapper`,E,{[`${e}--dropdown__wrapper--inline`]:T,[`${e}--list-box__wrapper--inline`]:T,[`${e}--dropdown__wrapper--inline--invalid`]:T&&r.invalid,[`${e}--list-box__wrapper--inline--invalid`]:T&&r.invalid,[`${e}--list-box__wrapper--fluid--invalid`]:t&&r.invalid,[`${e}--list-box__wrapper--slug`]:v,[`${e}--list-box__wrapper--decorator`]:h}),U=Ce({"aria-label":I||Q}),pe=O&&!t?p.createElement("div",{id:r.helperId,className:Me},O):null,he=a=>{oe(a.type==="focus"&&!x)},fe=l.useRef(null),ze=He(U.ref,Y,fe),[V,ge]=l.useState(),[be,de]=l.useState(!1),xe=l.useCallback(a=>{["ArrowDown","ArrowUp"," ","Enter"].includes(a.key)?be&&a.key===" "&&(V&&clearTimeout(V),ge(setTimeout(()=>{de(!1)},3e3))):(de(!0),V&&clearTimeout(V),ge(setTimeout(()=>{de(!1)},3e3))),["ArrowDown"].includes(a.key)&&oe(!1),["Enter"].includes(a.key)&&!x&&!g&&oe(!0),U.onKeyDown&&(a.key!=="ArrowUp"||g&&a.key==="ArrowUp")&&U.onKeyDown(a)},[be,V,U]),Re=l.useMemo(()=>w?{onClick:a=>{var c;a.preventDefault(),(c=fe.current)==null||c.focus()},onKeyDown:a=>{["ArrowDown","ArrowUp"," ","Enter"].includes(a.key)&&a.preventDefault()}}:{onKeyDown:xe},[w,xe]),Ae=l.useMemo(()=>me({ref:C||o?j.setFloating:null}),[o,me,j.setFloating,C]),ce=v??h,ye=qe(ce,Ze)?l.cloneElement(ce,{size:"mini"}):ce,we=ke(),Le=l.isValidElement(B)?{id:we.id}:we;return p.createElement("div",te({className:Pe},re),B&&p.createElement("label",te({className:Fe},Le),B),p.createElement(ae,{onFocus:he,onBlur:he,size:D,className:De,invalid:r.invalid,invalidText:$,invalidTextId:r.invalidId,warn:r.warn,warnText:P,warnTextId:r.warnId,light:K,isOpen:g,ref:C||o?j.setReference:null,id:F},r.invalid&&p.createElement(Ue,{className:`${e}--list-box__invalid-icon`}),r.warn&&p.createElement(Ve,{className:`${e}--list-box__invalid-icon ${e}--list-box__invalid-icon--warning`}),p.createElement("button",te({type:"button",className:`${e}--list-box__field`,disabled:r.disabled,"aria-disabled":w?!0:void 0,"aria-describedby":!T&&!r.invalid&&!r.warn&&pe?r.helperId:r.invalid?r.invalidId:r.warn?r.warnId:void 0,title:x&&b!==void 0?b(x):_e(A)},U,Re,{ref:ze}),p.createElement("span",{className:`${e}--list-box__label`},x?N?N(x):b(x):A),p.createElement(ae.MenuIcon,{isOpen:g,translateWithId:M})),v?ye:h?p.createElement("div",{className:`${e}--list-box__inner-wrapper--decorator`},ye):"",p.createElement(ae.Menu,Ae,g&&f.map((a,c)=>{const _=Te({item:a,index:c}),Z=b(a);return p.createElement(ae.MenuItem,te({key:_.id,isActive:x===a,isHighlighted:Ee===c,title:Z,disabled:_["aria-disabled"]},_),L?L(a):b(a),x===a&&p.createElement(Qe,{className:`${e}--list-box__menu-item__selected-icon`}))}))),!T&&!t&&!r.validation&&pe)});ie.displayName="Dropdown";ie.propTypes={"aria-label":i.string,ariaLabel:ue(i.string),autoAlign:i.bool,className:i.string,decorator:i.node,direction:i.oneOf(["top","bottom"]),disabled:i.bool,downshiftProps:i.object,helperText:i.node,hideLabel:i.bool,id:i.string.isRequired,initialSelectedItem:i.oneOfType([i.object,i.string,i.number]),invalid:i.bool,invalidText:i.node,itemToElement:i.func,itemToString:i.func,items:i.array.isRequired,label:i.node.isRequired,light:ue(i.bool),onChange:i.func,readOnly:i.bool,renderSelectedItem:i.func,selectedItem:i.oneOfType([i.object,i.string,i.number]),size:pt,slug:ue(i.node),titleText:i.node.isRequired,translateWithId:i.func,type:mt,warn:i.bool,warnText:i.node};const vt=({benchmarkId:o,style:E,onSelectPipeline:h,onOpenToolkitInsights:S,onOpenPipelineCompare:z,onOpenProfileCompare:R,onOpenErrorAnalysis:A})=>{const[I,Q]=l.useState(null),[b,L]=l.useState(!0),[N,X]=l.useState(null),[D,y]=l.useState(1),[F,B]=l.useState(10),[m,O]=l.useState(null),[M,K]=l.useState("overall");if(l.useEffect(()=>{(async()=>{try{L(!0),X(null),Q(null);const n=await(await ct(ut(`/api/benchmarks/${o}/summary/by-category`))).json();Q(n),O(n.default_sort_metric),K("overall"),y(1)}catch(t){X(t.message||"Failed to load benchmark summary")}finally{L(!1)}})()},[o]),N)return s.jsx(ve,{kind:"error",title:`Error loading summary for ${o}`,subtitle:N,lowContrast:!0});if(b)return s.jsxs("div",{style:{...E,display:"flex",flexDirection:"column",gap:"1rem"},children:[s.jsxs("h3",{style:{margin:0},children:[o," – Summary"]}),s.jsx(et,{description:`Loading benchmark summary for ${o}…`,status:"active"}),s.jsx(tt,{role:"progressbar",columnCount:5,rowCount:8})]});if(!I)return null;const G=M==="overall"?I.overall:I.categories[M]||[],$=new Set;G.forEach(e=>{Object.keys(e.metrics).forEach(t=>{t!=="num_records"&&t!=="num_evaluated"&&$.add(t)})});const ne=[{key:"name",header:"Pipeline"},...Array.from($).map(e=>({key:e,header:e}))],P=[...G].sort((e,t)=>{var d,f,k,g;if(!m)return 0;const n=((f=(d=e.metrics)==null?void 0:d[m])==null?void 0:f.average)??0;return(((g=(k=t.metrics)==null?void 0:k[m])==null?void 0:g.average)??0)-n}),W=e=>{var n;if(!m)return 0;const t=(n=e.metrics)==null?void 0:n[m];return typeof t=="number"?t:t&&typeof t=="object"&&typeof t.average=="number"?t.average:0},H=e=>{var n;if(!m)return 0;const t=(n=e.metrics)==null?void 0:n[m];return t&&typeof t=="object"&&typeof t.stddev=="number"?Math.max(0,t.stddev):0},J=e=>{var d;if(!m)return{low:0,high:0,hasCI:!1};const t=(d=e.metrics)==null?void 0:d[m];if(t&&typeof t=="object"&&typeof t.ci95_low=="number"&&typeof t.ci95_high=="number")return{low:t.ci95_low,high:t.ci95_high,hasCI:!0};const n=W(e),u=H(e);return{low:Math.max(0,n-u),high:n+u,hasCI:!1}},w=P.map(e=>({name:e.name,value:W(e),stddev:H(e),ci:J(e)})),v=w.reduce((e,t)=>Math.max(e,t.value,t.ci.high),0)||1,re=P.length,Y=(D-1)*F,C=Y+F,j=P.slice(Y,C),q=Array.from($),le=["overall",...Object.keys(I.categories)];return s.jsxs("div",{style:{...E,display:"flex",flexDirection:"column",gap:"0.5rem"},children:[I.has_full_results===!1&&s.jsx(ve,{kind:"info",title:"Summary-only mode",subtitle:`The full evaluation results file (${o}-predictions_eval.json) was not found. Overall pipeline metrics are shown from the summary file, but category breakdown and error analysis are unavailable. Download pre-computed results with: text2sql-eval-toolkit results fetch --benchmarks ${o} or run the evaluation pipeline locally (or fix TEXT2SQL_DATA_ROOT to a directory that already contains this file).`,lowContrast:!0}),s.jsxs("div",{style:{display:"flex",gap:"1rem",alignItems:"center"},children:[s.jsxs("h3",{style:{margin:0},children:[o," – Summary"]}),s.jsxs("div",{style:{marginLeft:"auto",display:"flex",gap:"0.75rem",alignItems:"center"},children:[S&&s.jsx(se,{kind:"ghost",size:"sm",onClick:()=>S(),children:"Metric Insights"}),z&&s.jsx(se,{kind:"ghost",size:"sm",onClick:()=>z(),children:"Pipeline Compare"}),R&&s.jsx(se,{kind:"ghost",size:"sm",onClick:()=>R(),children:"Profile Compare"}),A&&s.jsx(se,{kind:"ghost",size:"sm",onClick:()=>A(),children:"Error Analysis"}),s.jsx("div",{style:{minWidth:"220px"},children:s.jsx(ie,{id:"category-dropdown",titleText:"Query Category",label:M,items:le,selectedItem:M,onChange:e=>{K(e.selectedItem),y(1)}})}),q.length>0&&s.jsx("div",{style:{minWidth:"260px"},children:s.jsx(ie,{id:"sort-metric-dropdown",titleText:"Sort by metric",label:m||"Select metric",items:q,selectedItem:m,onChange:e=>{O(e.selectedItem),y(1)}})})]})]}),s.jsxs("div",{style:{border:"1px solid rgba(255,255,255,0.12)",borderRadius:"6px",padding:"0.75rem",background:"rgba(255,255,255,0.02)"},children:[s.jsxs("div",{style:{marginBottom:"0.5rem",fontWeight:600},children:["Pipeline performance by ",m||"selected metric"]}),s.jsx("div",{style:{maxHeight:"260px",overflow:"auto",display:"flex",flexDirection:"column",gap:"0.45rem"},children:w.map(e=>{const t=Math.max(2,e.value/v*100),n=Math.max(0,e.ci.low),u=Math.min(v,e.ci.high),d=n/v*100,f=u/v*100,k=Math.max(0,f-d),g=f>=99.9;return s.jsxs("div",{title:e.ci.hasCI?`${e.name}
|
|
2
|
+
Mean: ${e.value.toFixed(3)}
|
|
3
|
+
95% CI: [${e.ci.low.toFixed(3)}, ${e.ci.high.toFixed(3)}]`:`${e.name}
|
|
4
|
+
Mean: ${e.value.toFixed(3)}`,style:{display:"grid",gridTemplateColumns:"260px 1fr 56px",gap:"0.6rem",alignItems:"center"},children:[s.jsx("div",{title:e.name,style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",fontSize:"0.82rem",opacity:.9},children:e.name}),s.jsxs("div",{style:{height:"12px",background:"rgba(255,255,255,0.1)",borderRadius:"999px",overflow:"hidden",position:"relative"},children:[s.jsx("div",{style:{width:`${t}%`,height:"100%",background:"linear-gradient(90deg, #0f62fe, #78a9ff)",borderRadius:"999px"}}),u>n&&s.jsxs(s.Fragment,{children:[s.jsx("div",{style:{position:"absolute",left:`${d}%`,width:`${k}%`,top:"5.5px",height:"1px",background:"rgba(255,255,255,0.7)"}}),s.jsx("div",{style:{position:"absolute",left:`${d}%`,top:"3px",width:"1px",height:"6px",background:"rgba(255,255,255,0.7)"}}),s.jsx("div",{style:{position:"absolute",...g?{right:0}:{left:`${f}%`},top:"3px",width:"1px",height:"6px",background:"rgba(255,255,255,0.7)"}})]})]}),s.jsx("div",{style:{textAlign:"right",fontSize:"0.82rem"},children:e.value.toFixed(3)})]},`chart-${e.name}`)})})]}),s.jsxs("div",{style:{maxHeight:"360px",overflow:"auto"},children:[s.jsx("div",{style:{fontSize:"0.82rem",opacity:.85,marginBottom:"0.45rem"},children:"Tip: click a pipeline row in the table below for detailed pipeline analysis."}),s.jsx(st,{rows:j.map(e=>({id:e.name,name:e.name,...Object.fromEntries(Array.from($).map(t=>{const n=e.metrics[t];return n&&typeof n=="object"&&"average"in n?[t,n.average.toFixed(3)]:[t,n??""]}))})),headers:ne,size:"sm",children:({rows:e,headers:t,getHeaderProps:n})=>s.jsx(at,{children:s.jsxs(it,{"aria-label":"Pipeline summary",children:[s.jsx(nt,{children:s.jsx(je,{children:t.map(u=>{const{key:d,...f}=n({header:u});return s.jsx(rt,{...f,children:u.header},d)})})}),s.jsx(lt,{children:e.map(u=>s.jsx(je,{style:{cursor:h?"pointer":"default"},onClick:()=>h==null?void 0:h(u.id),children:u.cells.map(d=>s.jsx(ot,{children:d.value},d.id))},u.id))})]})})})]}),s.jsx(dt,{page:D,pageSize:F,pageSizes:[10,25,50],totalItems:re,onChange:({page:e,pageSize:t})=>{y(e),B(t)}})]})};export{vt as BenchmarkDetail};
|