arXiv:2412.07214cs.DBcs.AI2024-12被引 7

用大模型自动完成跨领域数据探索,从提问到可视化一气呵成。

Towards Automated Cross-domain Exploratory Data Analysis through Large Language Models

  • 构建分层数据上下文,提升跨数据库泛化能力
  • 端到端系统在Spider数据集上达86.3%查询准确率
  • 适合需要快速分析多源数据的工程师与分析师

探索性数据分析(EDA)结合SQL对数据分析师至关重要,但面临两大挑战:一是需熟练编写SQL查询,二是要生成合适的可视化类型以辅助结果解读。现有方法受限于复杂数据库结构、用户意图不明确、跨领域泛化能力差及缺乏端到端文本转可视化能力。本文提出TiInsight系统,采用分层数据上下文(HDC)机制,利用大模型总结数据库模式信息,增强开放世界下的跨域泛化能力。系统分为四个阶段:HDC生成、问题澄清与分解、文本转SQL(TiSQL)、数据可视化(TiChart)。已在PingCAP生产环境部署带友好GUI的端到端系统,并开源全部API。真实用户研究显示,该系统性能显著优于人类专家。其中TiSQL在Spider数据集上使用GPT-4实现86.3%执行准确率,且在Bird数据集上表现达到当前最优水平。

原文摘要 · Abstract (English)

Exploratory data analysis (EDA), coupled with SQL, is essential for data analysts involved in data exploration and analysis. However, data analysts often encounter two primary challenges: (1) the need to craft SQL queries skillfully, and (2) the requirement to generate suitable visualization types that enhance the interpretation of query results. Due to its significance, substantial research efforts have been made to explore different approaches to address these challenges, including leveraging large language models (LLMs). However, existing methods fail to meet real-world data exploration requirements primarily due to (1) complex database schema; (2) unclear user intent; (3) limited cross-domain generalization capability; and (4) insufficient end-to-end text-to-visualization capability. This paper presents TiInsight, an automated SQL-based cross-domain exploratory data analysis system. First, we propose hierarchical data context (i.e., HDC), which leverages LLMs to summarize the contexts related to the database schema, which is crucial for open-world EDA systems to generalize across data domains. Second, the EDA system is divided into four components (i.e., stages): HDC generation, question clarification and decomposition, text-to-SQL generation (i.e., TiSQL), and data visualization (i.e., TiChart). Finally, we implemented an end-to-end EDA system with a user-friendly GUI interface in the production environment at PingCAP. We have also open-sourced all APIs of TiInsight to facilitate research within the EDA community. Through extensive evaluations by a real-world user study, we demonstrate that TiInsight offers remarkable performance compared to human experts. Specifically, TiSQL achieves an execution accuracy of 86.3% on the Spider dataset using GPT-4. It also demonstrates state-of-the-art performance on the Bird dataset.

数据探索大模型文本转SQL可视化

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。