taoyds / spider

scripts and baselines for Spider: Yale complex and cross-domain semantic parsing and text-to-SQL challenge
https://yale-lily.github.io/spider
Apache License 2.0
812 stars 193 forks source link

Wrong .sql file in database folder wta_1.sql #53

Open CrafterKolyan opened 4 years ago

CrafterKolyan commented 4 years ago

Steps to find wrong .sql file:

  1. Get latest Spider dataset from here: https://drive.google.com/uc?export=download&id=1_AckYkinAnhqmRQtGsQgUKAnTHxxX5J0
  2. Extract archive
  3. Go to database/wta_1
  4. Open wta_1.sql
  5. Look at first line Expected: CREATE TABLE players( Actual: CRloser_rank_pointsEATE TABLE players(

This is the origin of #52.

wta_1.sqlite file should be also updated.

CrafterKolyan commented 4 years ago

Even more. wta_1.sqlite doesn't have table qualifying_matches which is in wta_1.sql

CrafterKolyan commented 4 years ago

I've fixed the problem by myself. Fixed Spider Dataset can be found here: https://drive.google.com/file/d/1m68AHHPC4pqyjT-Zmt-u8TRqdw5vp-U5/view You can check for extra fixes here: https://github.com/CrafterKolyan/spider-fixed

PhillipRt commented 1 year ago

@CrafterKolyan even with your repo and fixed dataset i still get this issue running train_gold agains train_gold !python /content/spider-fixed/evaluation.py --gold /content/spider/train_gold.sql --pred /content/spider/train_gold.sql --etype all --db /content/spider/database --table /content/spider/tables.json

Traceback (most recent call last): File "/content/spider-fixed/evaluation.py", line 833, in evaluate(gold, pred, db_dir, etype, kmaps) File "/content/spider-fixed/evaluation.py", line 468, in evaluate g_sql = get_sql(schema, g_str) File "/content/spider-fixed/process_sql.py", line 554, in getsql , sql = parse_sql(tokens, 0, tables_with_alias, schema) File "/content/spider-fixed/process_sql.py", line 506, in parse_sql from_end_idx, table_units, conds, default_tables = parse_from(tokens, start_idx, tables_with_alias, schema) File "/content/spider-fixed/process_sql.py", line 391, in parse_from idx, table_unit, table_name = parse_table_unit(tokens, idx, tables_with_alias, schema) File "/content/spider-fixed/process_sql.py", line 260, in parse_table_unit key = tables_with_alias[tokens[idx]] KeyError: 'ref_company_types'

Do you know why this is the case?

BoCiFOM commented 1 year ago

I get the same error like @PhillipRt - any fixes for this?