vaishali/multitabqa-base-geoquery
Table Question Answering • 0.1B • Updated • 2
query stringlengths 58 502 | question stringlengths 15 99 | answer stringlengths 50 10k | table_names sequence | tables sequence | source stringlengths 1.43k 24.4k | target stringlengths 23 11.2k |
|---|---|---|---|---|---|---|
SELECT state.area FROM state WHERE state.state_name='texas'; | what is the size of texas | {"columns":["area"],"index":[0],"data":[[266807.0]]} | [
"state"
] | [
"{\"columns\":[\"state_name\",\"population\",\"area\",\"country_name\",\"capital\",\"density\"],\"index\":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50],\"data\":[[\"alabama\",3894000,51700.0,\"usa\",\"montgomery\",75.... | what is the size of texas <table_name> : state col : state_name | population | area | country_name | capital | density row 1 : alabama | 3894000 | 51700 | usa | montgomery | 75.3191489362 row 2 : alaska | 401800 | 591000 | usa | juneau | 0.6798646362 row 3 : arizona | 2718000 | 114000 | usa | phoenix | 23.8421052632 ro... | col : area row 1 : 266807 |
SELECT city.city_name FROM city WHERE city.state_name='nebraska' AND city.population=(SELECT max(city.population) FROM city WHERE city.state_name='nebraska'); | what is the biggest city in nebraska | {"columns":["city_name"],"index":[0],"data":[["omaha"]]} | [
"city"
] | [
"{\"columns\":[\"city_name\",\"population\",\"country_name\",\"state_name\"],\"index\":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,7... | what is the biggest city in nebraska <table_name> : city col : city_name | population | country_name | state_name row 1 : birmingham | 284413 | usa | alabama row 2 : mobile | 200452 | usa | alabama row 3 : montgomery | 177857 | usa | alabama row 4 : huntsville | 142513 | usa | alabama row 5 : tuscaloosa | 75143 | usa |... | col : city_name row 1 : omaha |
SELECT city.population FROM city WHERE city.city_name='chicago'; | how many people live in chicago | {"columns":["population"],"index":[0],"data":[[3005172]]} | [
"city"
] | [
"{\"columns\":[\"city_name\",\"population\",\"country_name\",\"state_name\"],\"index\":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,7... | how many people live in chicago <table_name> : city col : city_name | population | country_name | state_name row 1 : birmingham | 284413 | usa | alabama row 2 : mobile | 200452 | usa | alabama row 3 : montgomery | 177857 | usa | alabama row 4 : huntsville | 142513 | usa | alabama row 5 : tuscaloosa | 75143 | usa | alab... | col : population row 1 : 3005172 |
SELECT state.population FROM state WHERE state.state_name='new mexico'; | how many people live in new mexico | {"columns":["population"],"index":[0],"data":[[1303000]]} | [
"state"
] | [
"{\"columns\":[\"state_name\",\"population\",\"area\",\"country_name\",\"capital\",\"density\"],\"index\":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50],\"data\":[[\"alabama\",3894000,51700.0,\"usa\",\"montgomery\",75.... | how many people live in new mexico <table_name> : state col : state_name | population | area | country_name | capital | density row 1 : alabama | 3894000 | 51700 | usa | montgomery | 75.3191489362 row 2 : alaska | 401800 | 591000 | usa | juneau | 0.6798646362 row 3 : arizona | 2718000 | 114000 | usa | phoenix | 23.8421... | col : population row 1 : 1303000 |
SELECT city.city_name FROM city WHERE city.state_name='texas' AND city.population>150000; | what are the major cities in texas | {"columns":["city_name"],"index":[0,1,2,3,4,5,6,7,8],"data":[["houston"],["dallas"],["san antonio"],["el paso"],["fort worth"],["austin"],["corpus christi"],["lubbock"],["arlington"]]} | [
"city"
] | [
"{\"columns\":[\"city_name\",\"population\",\"country_name\",\"state_name\"],\"index\":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,7... | what are the major cities in texas <table_name> : city col : city_name | population | country_name | state_name row 1 : birmingham | 284413 | usa | alabama row 2 : mobile | 200452 | usa | alabama row 3 : montgomery | 177857 | usa | alabama row 4 : huntsville | 142513 | usa | alabama row 5 : tuscaloosa | 75143 | usa | a... | col : city_name row 1 : houston row 2 : dallas row 3 : san antonio row 4 : el paso row 5 : fort worth row 6 : austin row 7 : corpus christi row 8 : lubbock row 9 : arlington |
SELECT city.state_name FROM city WHERE city.city_name='austin' AND city.population > 150000; | which states have a major city named austin ? | {"columns":["state_name"],"index":[0],"data":[["texas"]]} | [
"city"
] | [
"{\"columns\":[\"city_name\",\"population\",\"country_name\",\"state_name\"],\"index\":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,7... | which states have a major city named austin ? <table_name> : city col : city_name | population | country_name | state_name row 1 : birmingham | 284413 | usa | alabama row 2 : mobile | 200452 | usa | alabama row 3 : montgomery | 177857 | usa | alabama row 4 : huntsville | 142513 | usa | alabama row 5 : tuscaloosa | 7514... | col : state_name row 1 : texas |
SELECT city.state_name FROM city WHERE city.city_name='kalamazoo'; | which state is kalamazoo in | {"columns":["state_name"],"index":[0],"data":[["michigan"]]} | [
"city"
] | ["{\"columns\":[\"city_name\",\"population\",\"country_name\",\"state_name\"],\"index\":[0,1,2,3,4,5(...TRUNCATED) | "which state is kalamazoo in <table_name> : city col : city_name | population | country_name | state(...TRUNCATED) | col : state_name row 1 : michigan |
SELECT count(border_info.border) FROM border_info WHERE border_info.state_name='hawaii'; | how many states border hawaii | {"columns":["count(border_info.border)"],"index":[0],"data":[[0]]} | [
"border_info"
] | ["{\"columns\":[\"state_name\",\"border\"],\"index\":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18(...TRUNCATED) | "how many states border hawaii <table_name> : border_info col : state_name | border row 1 : alabama (...TRUNCATED) | col : count(border_info.border) row 1 : 0 |
SELECT state.state_name FROM state WHERE state.area=(SELECT min(state.area) FROM state); | what is the smallest state in the usa | {"columns":["state_name"],"index":[0],"data":[["district of columbia"]]} | [
"state"
] | ["{\"columns\":[\"state_name\",\"population\",\"area\",\"country_name\",\"capital\",\"density\"],\"i(...TRUNCATED) | "what is the smallest state in the usa <table_name> : state col : state_name | population | area | c(...TRUNCATED) | col : state_name row 1 : district of columbia |
SELECT state.state_name FROM state WHERE state.area=(SELECT max(state.area) FROM state); | what is the biggest state in continental us | {"columns":["state_name"],"index":[0],"data":[["alaska"]]} | [
"state"
] | ["{\"columns\":[\"state_name\",\"population\",\"area\",\"country_name\",\"capital\",\"density\"],\"i(...TRUNCATED) | "what is the biggest state in continental us <table_name> : state col : state_name | population | ar(...TRUNCATED) | col : state_name row 1 : alaska |
import pandas as pd
from datasets import load_dataset
geoQuery_tableQA = load_dataset("vaishali/geoQuery-tableQA")
for sample in geoQuery_tableQA['train']:
question = sample['question']
input_table_names = sample["table_names"]
input_tables = [pd.read_json(table, orient='split') for table in sample['tables']]
answer = pd.read_json(sample['answer'], orient='split')
# flattened input/output
input_to_model = sample["source"]
target = sample["target"]
@inproceedings{pal-etal-2023-multitabqa,
title = "{M}ulti{T}ab{QA}: Generating Tabular Answers for Multi-Table Question Answering",
author = "Pal, Vaishali and
Yates, Andrew and
Kanoulas, Evangelos and
de Rijke, Maarten",
booktitle = "Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)",
month = jul,
year = "2023",
address = "Toronto, Canada",
publisher = "Association for Computational Linguistics",
url = "https://aclanthology.org/2023.acl-long.348",
doi = "10.18653/v1/2023.acl-long.348",
pages = "6322--6334",
abstract = "Recent advances in tabular question answering (QA) with large language models are constrained in their coverage and only answer questions over a single table. However, real-world queries are complex in nature, often over multiple tables in a relational database or web page. Single table questions do not involve common table operations such as set operations, Cartesian products (joins), or nested queries. Furthermore, multi-table operations often result in a tabular output, which necessitates table generation capabilities of tabular QA models. To fill this gap, we propose a new task of answering questions over multiple tables. Our model, MultiTabQA, not only answers questions over multiple tables, but also generalizes to generate tabular answers. To enable effective training, we build a pre-training dataset comprising of 132,645 SQL queries and tabular answers. Further, we evaluate the generated tables by introducing table-specific metrics of varying strictness assessing various levels of granularity of the table structure. MultiTabQA outperforms state-of-the-art single table QA models adapted to a multi-table QA setting by finetuning on three datasets: Spider, Atis and GeoQuery.",
}