GithubHelp home page GithubHelp logo

Comments (4)

lihaoyang-ruc avatar lihaoyang-ruc commented on July 23, 2024

text2natsql这边主要应用了两个后处理步骤:
一个是修复生成的natsql中存在的致命错误。

pred_natsql = fix_fatal_errors_in_natsql(pred_natsql, batch_tc_original[batch_id])

具体来说,我发现在极少数情况下,T5生成的sql会出现数据库中不存在的表名、列名,但是这些不存在的表名和列名能在数据库中能找到非常类似的表/列(举个例子,模型有时候会生成car_name表,但在数据库中的表名其实是car_names),因此我写了一个基于字符串匹配的修复函数来试图缓解这个问题。要注意的是,这个步骤不能保证修复后的natsql是完全没有问题的。

另一个就是将模型生成的natsql翻译回sql,因为natsql只是sql的一个中间表示。

pred_sql = natsql_to_sql(pred_natsql, db_id, db_file_path, table_dict[db_id]).strip()

from resdsql.

ManchesterWuer avatar ManchesterWuer commented on July 23, 2024

@lihaoyang-ruc natsql翻译成sql,有损失吗?我看他们的paper,貌似准确率>90%。

from resdsql.

lihaoyang-ruc avatar lihaoyang-ruc commented on July 23, 2024

有损失的,不能完全保证natsql翻译成正确的sql,但由于natsql相比于sql更简单,因此模型会学的更好,这是一个trade-off。

from resdsql.

694344851 avatar 694344851 commented on July 23, 2024

请问一下,这个natsql具体做了一个怎么样的事情,可以具体一个例子么,论文看了,但是没有特别明白

from resdsql.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.