--- license: cc-by-4.0 task_categories: - text-retrieval language: - en size_categories: - n<1K tags: - table-retrieval - keyword-search - data-discovery - tables pretty_name: AW configs: - config_name: metadata data_files: - split: all path: metadata.csv - config_name: queries data_files: - split: all path: queries.csv - config_name: qrels data_files: - split: all path: qrels.csv --- # AW ## Dataset Summary AW is a dataset for **keyword search over tables (KWS-over-tables)**: given a short natural-language keyword query (e.g., *"employee phone number"*), a retrieval system must rank the tables in a corpus by their relevance to the query. The task is the table analog of text retrieval — instead of returning documents, the system returns structured tables — and is motivated by enterprise data discovery, where analysts who know roughly what they need must locate the right table in a database with many cryptically named ones. The corpus is a modified version of the AdventureWorks Microsoft sample database. Column names have been manually abbreviated (e.g., `BusEntId`, `DTPh`, `STRGUID`) to simulate the low-information schemas common in real enterprise data. Relevance judgments are **binary (0 or 1)** and were produced by manual inspection of every (query, table) pair in the full 96 × 15 = 1,440 Cartesian product. The 60 pairs marked relevant (`1`) are listed in `qrels.csv`; pairs not listed are non-relevant. AW is one of six datasets in an evaluation suite for this task; each dataset is published as its own Hugging Face repo following the same schema. ## How to Use AW is an **evaluation-only** benchmark — there is no train/test split. All rows live in a single split named `all`. (Hugging Face's `datasets` library requires every config to declare a split; `all` is used here in place of the default `train` label to avoid implying training data.) ```python from datasets import load_dataset # Tables, queries, and binary relevance judgments metadata = load_dataset("anhaidgroup/aw", "metadata", split="all") # 96 tables queries = load_dataset("anhaidgroup/aw", "queries", split="all") # 15 queries qrels = load_dataset("anhaidgroup/aw", "qrels", split="all") # 60 relevant pairs ``` For methods that consume tuple-level data, download the per-table tuples archive separately: ```python from huggingface_hub import hf_hub_download import zipfile, pandas as pd zip_path = hf_hub_download("anhaidgroup/aw", "tuples.zip", repo_type="dataset") with zipfile.ZipFile(zip_path) as z: with z.open("Tuples/Sales-17.csv") as f: df = pd.read_csv(f) ``` Methods that retrieve over table metadata (table name and column names) only need `metadata`, `queries`, and `qrels`. Methods that retrieve over actual tuple values additionally need `tuples.zip`. ## Dataset Structure ### Files | file | size | purpose | |---|---|---| | `metadata.csv` | 96 rows | one row per table; identifier, name, column names | | `queries.csv` | 15 rows | one row per query; identifier and query text | | `qrels.csv` | 60 rows | binary relevance judgments (positive pairs only) | | `tuples.zip` | 96 inner CSVs | per-table tuple data, one CSV per table | ### Schema `metadata.csv` | column | type | description | |---|---|---| | `table_id` | str | unique identifier, e.g., `Person-0`, `Sales-17` | | `table_name` | str | name from the source schema | | `column_names` | str | JSON-encoded list of column names; parse with `json.loads` | `queries.csv` | column | type | description | |---|---|---| | `query_id` | str | unique identifier, e.g., `q1`, `q2` | | `query` | str | natural-language keyword query | `qrels.csv` — positive-only convention: only relevant (query, table) pairs are listed. Pairs not listed are treated as non-relevant. | column | type | description | |---|---|---| | `query_id` | str | foreign key to `queries.csv` | | `table_id` | str | foreign key to `metadata.csv` | | `relevance_score` | int | always `1` (binary judgments) | `tuples.zip` — archive of per-table CSV files. - Inner layout: `Tuples/.csv` (one file per table). - Each inner CSV: header on row 0 (matching the `column_names` entry in `metadata.csv` for that `table_id`), tuples on subsequent rows, RFC 4180 quoting. - Some tables (e.g., `Production-2`) contain multi-line quoted text fields. Use a CSV parser that respects quoting (`pandas.read_csv` works); avoid line-based tools. ### Statistics 96 tables span six namespaces from the source schema: `Person` (13), `Sales` (19), `dbo` (28), `Production` (25), `Purchasing` (5), `HumanResources` (6). Per-query relevant-table counts range from 1 to 8 (median 4). ## Dataset Creation ### Source Data The corpus is built from a modified version of AdventureWorks, Microsoft's sample relational database for SQL Server demos. The schema modification is the manual abbreviation of column names — tuple values are unchanged from the original. This modified schema was originally introduced in the Columbo system to study retrieval and discovery on schemas with low-information names. ### Annotations All 1,440 candidate (query, table) pairs (96 tables × 15 queries) were manually inspected. A pair was marked relevant (`1`) if the table contains data that would satisfy the query, judged from the table name, column names, and a sample of tuple values. Pairs not marked are non-relevant. The positive-only convention (60 entries listed in `qrels.csv`, the rest treated as non-relevant by absence) follows TREC qrels practice. ## Considerations for Using the Data ### Tuple downsampling This release caps each table's tuples at 500,000 rows, applied as `df.head(500_000)` against the source — the first 500k rows of each table preserving the original ordering. Tables with fewer than 500k rows are unaffected. `metadata.csv` and `qrels.csv` were produced against the un-capped corpus. Methods that rely only on table metadata (table name and column names) are unaffected by the cap. Methods that inspect actual tuple values may produce a deflated score relative to the same method evaluated on the un-capped corpus, since some relevant cells in tail rows of large tables may not appear in `tuples.zip`. A future release will include the un-capped tuples. ## License The dataset is released under [CC-BY-4.0](https://creativecommons.org/licenses/by/4.0/). You are free to share and adapt the material with attribution. The source AdventureWorks database is a Microsoft sample. ## Citation A citation will be added once the associated paper is published. ## Authors Minh Phan, Ting Cai, AnHai Doan.