DIN-SQL论文阅读 N2sql

DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-Correction 论文阅读 NeurIPS 2023

GitHub Repository

论文贡献可以总结如下:

1. 通过任务分解提高基于LLM的文本到SQL模型的性能。
2. 引入针对任务复杂度的自适应提示策略。
3. 在提示的背景下解决模式链接挑战。
4. 使用LLM进行自我纠错。

整体架构图:
将问题分解成更小的子问题,解决每个子问题,并使用这些解决方案来构建原始问题的解决方案。

在这里插入图片描述

上述各个module基于prompt实现,下面是对各个module的展开。

  • Schema Linking Module:

    Schema Linking负责在自然语言查询中识别对数据库模式和条件值的引用。
    Prompt示例:
    #Find the schema_links for generating SQL queries for each question based on the database schema and Foreign keys.
    Table city, columns=[,City_ID,Official_Name,Status,Area_km_2,Population,Census_Ranking]
    Table competition_record, columns = [*,Competition_ID,Farm_ID,Rank]
    Table farm, columns = [*,Farm_ID,Year,Total_Horses,Working_Horses,
    Total_Cattle,Oxen,Bulls,Cows,Pigs,Sheep_and_Goats]
    Table farm_competition, columns = [*,Competition_ID,Year,Theme,H

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值