Comments (15)
如需添加新表,请参考Spider数据集中tables.json的格式。
from resdsql.
因为模型需要用到数据库的内容以及在数据库上进行执行检查,你还需要在database文件夹中创建一个同名的sqlite数据库。
from resdsql.
我这边已经在database上创建了同名的sqlite和sql数据,并且将新表添加进table.json格式。用的resdsql-3b-natsql. 但是还是不行,但是新表没有natsql的内容,是要在添加新表的natsql么
from resdsql.
请问在哪一步报错,错误是什么?
from resdsql.
sql placeholder
near "sql": syntax error
Before fix: select count ( distinct pre-sale mutual transfer.service no ) from pre-sale mutual transfer
After fix: select count ( distinct pre-sale mutual pre-sale mutual transfer.acceptance unit no ) from pre-sale mutual transfer mutual transfer
sql placeholder
near "sql": syntax error
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:01<00:00, 1.33s/it]
['sql placeholder']
应该是在text2sql.py中最后deocde_natsqls 那边有错误,会直接生成['sql placeholder']
from resdsql.
这是正常的,我们的模型在beam search结果中没有找到任何一个可以执行的SQL时,会默认使用sql placeholder占位。请问你现在把beam size设置到多大呢?
from resdsql.
请问“pre-sale mutual transfer.service no ”是一个列的名字吗?如果是,我们的模型暂时不支持table和column中带有空格的SQL语句,您可能需要修改我们的代码。
from resdsql.
如果您的table和column中带有空格,您可以尝试使用resdsql-3b-sql版本(虽然我也不确定是否会有新的错误出现,因为我们设计以及评估时使用的数据集不存在带有空格的table和column这种情况)。据我所知,resdsql-3b-natsql是完全不能处理这种情况的,这是因为我们在resdsql-3b-natsql中增加了一个后置处理错误模块(请关注./utils/text2sql_decoding_utils.py中fix_fatal_errors_in_natsql函数和tokenize_natsql函数),在tokenize_natsql函数中,我们使用空格对natsql进行tokenize。
from resdsql.
pre-sale mutual transfer.service no,是一个列的名字,那是不是将 空格替换为_下划线的话,是不是可以生成sql。
我是单例进行测试的,就一个问题。
['sql placeholder']这个并不是模型错误,而是没有可执行的SQL就回变成这个么。
我做这个的想法是,想添加一个新表,看一下这个模型的泛化性
from resdsql.
面对这个问题,一种更简单的方案是,您可以把table和column中的空格替换成下划线,这样应该可以正常使用natsql版本。
如果您的table和column中带有空格,您可以尝试使用resdsql-3b-sql版本(虽然我也不确定是否会有新的错误出现,因为我们设计以及评估时使用的数据集不存在带有空格的table和column这种情况)。据我所知,resdsql-3b-natsql是完全不能处理这种情况的,这是因为我们在resdsql-3b-natsql中增加了一个后置处理错误模块(请关注./utils/text2sql_decoding_utils.py中fix_fatal_errors_in_natsql函数和tokenize_natsql函数),在tokenize_natsql函数中,我们使用空格对natsql进行tokenize。
from resdsql.
“['sql placeholder']这个并不是模型错误,而是没有可执行的SQL就回变成这个么。” 是这样的,您的理解是正确的。
from resdsql.
但是 我看原始的spider中的tables.json中有的列名也是含有空格的 比如"people id"。
没有可执行的SQL,也就是说这个问题生成不出来么,在添加的新表中没有达到text2sql的效果?
from resdsql.
您说的“people id”应该是tables.json中的column_names字段,而目标SQL中用的是column_names_original字段。column_names(论文中是semantic names)被用在我们的cross-encoder阶段,而column_names_original (论文中是original names)被用在后面的seq2seq阶段。您可以查看我们的论文,来了解他们的区别。
from resdsql.
好的,我大概明白了,我去修改一下下划线,十分感谢您的回答
from resdsql.
好的,祝您好运。
from resdsql.
Related Issues (20)
- Cspider不加natsql训练步骤,运行到第二步的时候报错:RuntimeError: input must have 3 dimensions, got 2 HOT 3
- nltk_downlader里面下载的内容有用到吗? HOT 1
- 请问如果要自己准备dataset做训练或者测试,有什么格式要求吗? HOT 5
- XLM-ROBERTA-LARGE做分类的模型如何多卡运行? HOT 2
- How can we optimize the Model Inference time. Single NLQ taking more than a 45seconds. HOT 1
- natsql是如何转换的?如何取骨架? HOT 1
- Execuse me. What happened to paper CodeS? Isn't this article open source before? HOT 9
- Low training metrics HOT 14
- Support for Historical Conversation in RESDSQL HOT 4
- Question about evaluation scripts HOT 2
- 请问推理方法 HOT 2
- 最低支持的GPU内存是多少,我怎么跑不起来。
- Dev result file?
- 部分带有别名的sql在经过normalization处理后出现错误 HOT 2
- Inference script not working HOT 5
- CoSQL HOT 1
- 训练Cross-Encoder的时候为什么24G的显存还不够用? HOT 1
- 关于RESDSQL在BIRD上的运行时间 HOT 2
- Training cross-coder error HOT 1
- xlm_roberta_text2natsql_schema_item_classifier HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from resdsql.