自然语言查库:让模型写 SQL
生成 → 执行 → 校验
Why this chapter
问“上季度哪条线亏得最多”,答案在数据库里,不在聊天框里。让模型写 SQL,再拿执行结果校验——不校验的生成只是猜。
ToolsPython · SQLite · LLM
Deliverable检索式 text-to-SQL + 执行结果比对
Key numbers| 涉及表 | 12 张(示意) |
|---|---|
| 单次生成 | ≈2 s |
| 执行校验 | 错误率 30% → 6%(示意) |
浮点累加顺序:为什么同一份数据算两次不一样
· David Goldberg · 1991
审计准确率 82%:模型负责找,程序负责算
· Wang, Ai, Patel, Peng, Mo, Cao, Li, Cao, Qian, Gutierrez-Basulto · 2026
给了流程就从 25% 到 85%:模型不是不会,是没查完
· Guan, Liu, Cao · 2026
The chapter body is for enrolled learners. The outline above is public: see what the chapter solves before deciding to register.
© SailiTech · Printed at: