Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Help] 如何通过微调提升 text2sql 能力? #52

Open
xiaotianhxf opened this issue Apr 15, 2023 · 2 comments
Open

[Help] 如何通过微调提升 text2sql 能力? #52

xiaotianhxf opened this issue Apr 15, 2023 · 2 comments

Comments

@xiaotianhxf
Copy link

求助:如何通过微调提升模型的text2sql能力?

  1. 如何给模型注入库表信息、业务知识?
  2. 如何校正模型输出的SQL?

当前给出一个建表语句(比如一张用户登录日志表),再问一个问题(比如 当天的DAU是多少), chatglm会给出错误的sql语句。 比如加了一些无关的字段、sql关键字之间没有空格、用户没有去重等

期望通过微调,提升模型的text2sql能力。

期望注入:

  1. 建库建表语句
  2. 表字段的关联关系: 比如A.a = B.b
  3. 业务知识: 比如投资roi怎么计算

问题:

  1. 今天XX的DAU是多少
  2. 最近7天XX的roi是多少

输出:
select count(distinct yourid) from your_table where date = today()

从your_table表查询XX的DAU, 以yourid字段作为用户的唯一标识,以date字段作为过滤时间。通过count(distinct yourid)进行去重统计,date=today() 指定为今天。

@highroom
Copy link

我也想知道,有没有大佬指导下

@zhanghy-sketchzh
Copy link

可以关注一下DB-GPT-HUB项目,https://github.com/csunny/DB-GPT-Hub

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants