avinot's picture
Update README.md
1473c4c verified
metadata
task_categories:
  - text2text-generation
language:
  - en
size_categories:
  - 1K<n<10K
tags:
  - schema-summarization
modalities:
  - Text

Dataset Card for schema-summarization_spider

Dataset Description

Dataset Summary

This dataset has been built to train and benchmark models uppon the schema-summarization task. This task aims to generate the smallest schema needed to answer a NL question with the help of the original database schema. This dataset has been build by crossing these two datasets :

  • xlangai/spider
  • richardr1126/spider-schema

With the first dataset we take the natural language question and the SQL query. With the second dataset we take the associated schema of the database id used to answer the question. We then generate the summarized-schema with the help of the SQL query

Languages

As the xlangai/spider and richardr1126/spider-schema are only labelled in english, this dataset is also labelled in english

Dataset Structure

Data Fields

  • db_id : The Database name
  • question : The natural language question
  • schema : The full schema
  • summarized-schema : A subset of the full schema to answer the question
  • shrink-score : The percentage of columns removed from the original schema

Data Splits

  • train : 6985 questions, schema and summarized-schema tuples
  • validation : 1032 questions, schema and summarized-schema tuples

Dataset Creation

Process

So in order to create the summarized schema we proceded into several steps. First we go through every words in the orginal SQL query and see if it matches any column names in the original schema. And we add every column that we find this way. In order to leverage the '*' wildcard we automatically include the primary key of each table that is within the original SQL query

Source Data

As explained above the natural question and SQL queries that answers this question are extracted from the xlangai/spider dataset and the databases schemas are extracted from the richardr1126/spider-schema dataset.

TODO

  • Fix rows with empty summarized-schema
  • Fix overwhelmingly long summarized-schema. Sometimes the needed columns has the same name in diferent tables. We need to only include it once (Maybe ?)
  • Remove primary key from summarized-schema when the '*' wildcard is not used
  • Add a shrinking score
  • Prompt engineer Llama3.1:70b with a 1-shot example to generate better summarized-schema
  • Find a way to add data from WikiSQL