PaddlePaddle / PaddleNLP

👑 Easy-to-use and powerful NLP and LLM library with 🤗 Awesome model zoo, supporting wide-range of NLP tasks from research to industrial applications, including 🗂Text Classification, 🔍 Neural Search, ❓ Question Answering, ℹ️ Information Extraction, 📄 Document Intelligence, 💌 Sentiment Analysis etc.
https://paddlenlp.readthedocs.io
Apache License 2.0
12k stars 2.92k forks source link

[Question]: 请问text to sql例子中的训练集是用什么工具生成的?训练集各个字段的意义是什么? #6302

Open cactusgame opened 1 year ago

cactusgame commented 1 year ago

请提出你的问题

对于下面的训练文件,有几个问题

  1. 较复杂的select和where部分,各个嵌套数组分别代表什么?
  2. 下面的json,需要使用什么标注工具?
  3. 是否存在生成下面json的源码?
  {
        "query": "select 明星id from 离异明星 where 离异时间 < 2002", 
        "db_id": "明星关系", 
        "question": "哪些明星在2002年之前离婚的?", 
        "question_id": "qid000002", 
        "sql": {
            "orderBy": [], 
            "from": {
                "table_units": [
                    [
                        "table_unit", 
                        2
                    ]
                ], 
                "conds": []
            }, 
            "union": null, 
            "except": null, 
            "having": [], 
            "limit": null, 
            "intersect": null, 
            "where": [
                [
                    0, 
                    4, 
                    [
                        0, 
                        [
                            0, 
                            12, 
                            false
                        ], 
                        null
                    ], 
                    2002, 
                    null
                ]
            ], 
            "groupBy": [], 
            "select": [
                [
                    0, 
                    [
                        0, 
                        [
                            0, 
                            10, 
                            false
                        ], 
                        null
                    ]
                ]
            ]
        }
    }

image

llsjdkn commented 11 months ago

数组的含义可以区看config里面的Dusql.asdl文件。转换的源码也没找到。