API-Assisted Code Generation for Question Answering on Varied Table Structures

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Cao, Yihan, Chen, Shuyi, Liu, Ryan, Wang, Zhiruo, Fried, Daniel
Format: Preprint
Veröffentlicht: 2023
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866910870284533760
author Cao, Yihan
Chen, Shuyi
Liu, Ryan
Wang, Zhiruo
Fried, Daniel
author_facet Cao, Yihan
Chen, Shuyi
Liu, Ryan
Wang, Zhiruo
Fried, Daniel
contents A persistent challenge to table question answering (TableQA) by generating executable programs has been adapting to varied table structures, typically requiring domain-specific logical forms. In response, this paper introduces a unified TableQA framework that: (1) provides a unified representation for structured tables as multi-index Pandas data frames, (2) uses Python as a powerful querying language, and (3) uses few-shot prompting to translate NL questions into Python programs, which are executable on Pandas data frames. Furthermore, to answer complex relational questions with extended program functionality and external knowledge, our framework allows customized APIs that Python programs can call. We experiment with four TableQA datasets that involve tables of different structures -- relational, multi-table, and hierarchical matrix shapes -- and achieve prominent improvements over past state-of-the-art systems. In ablation studies, we (1) show benefits from our multi-index representation and APIs over baselines that use only an LLM, and (2) demonstrate that our approach is modular and can incorporate additional APIs.
format Preprint
id arxiv_https___arxiv_org_abs_2310_14687
institution arXiv
publishDate 2023
record_format arxiv
spellingShingle API-Assisted Code Generation for Question Answering on Varied Table Structures
Cao, Yihan
Chen, Shuyi
Liu, Ryan
Wang, Zhiruo
Fried, Daniel
Computation and Language
Artificial Intelligence
A persistent challenge to table question answering (TableQA) by generating executable programs has been adapting to varied table structures, typically requiring domain-specific logical forms. In response, this paper introduces a unified TableQA framework that: (1) provides a unified representation for structured tables as multi-index Pandas data frames, (2) uses Python as a powerful querying language, and (3) uses few-shot prompting to translate NL questions into Python programs, which are executable on Pandas data frames. Furthermore, to answer complex relational questions with extended program functionality and external knowledge, our framework allows customized APIs that Python programs can call. We experiment with four TableQA datasets that involve tables of different structures -- relational, multi-table, and hierarchical matrix shapes -- and achieve prominent improvements over past state-of-the-art systems. In ablation studies, we (1) show benefits from our multi-index representation and APIs over baselines that use only an LLM, and (2) demonstrate that our approach is modular and can incorporate additional APIs.
title API-Assisted Code Generation for Question Answering on Varied Table Structures
topic Computation and Language
Artificial Intelligence
url https://arxiv.org/abs/2310.14687