Data visualization (DV) systems are increasingly recognized for their profound capability to uncover insights from vast datasets, gaining attention across both industry and academia. Crafting data queries is an essential process within certain declarative visualization languages (DVLs, e.g., Vega-Lite, EChart.). The evolution of natural language processing (NLP) technologies has streamlined the use of natural language interfaces to visualize tabular data, offering a more accessible and intuitive user experience. However, current methods for converting natural language questions into data visualization queries, such as Seq2Vis, ncNet, and RGVisNet, despite utilizing complex neural network architectures, still fall short of expectations and have great room for improvement. Large language models (LLMs) such as ChatGPT and GPT-4, have established new benchmarks in a variety of NLP tasks, fundamentally altering the landscape of the field. Inspired by these advancements, we introduce a novel framework, Prompt4Vis, leveraging LLMs and in-context learning to enhance the performance of generating data visualization from natural language. Prompt4Vis comprises two key components: (1) a multi-objective example mining module, designed to find out the truly effective examples that strengthen the LLM's in-context learning capabilities for text-to-vis; (2) a schema filtering module, which is proposed to simplify the schema of the database. Extensive experiments through 5-fold cross-validation on the NVBench dataset demonstrate the superiority of Prompt4Vis, which notably surpasses the state-of-the-art (SOTA) RGVisNet by approximately 35.9% and 71.3% on dev and test sets, respectively. To the best of our knowledge, Prompt4Vis is the first work that introduces in-context learning into the text-to-vis for generating data visualization queries.
翻译:数据可视化系统因其从海量数据集中挖掘深刻洞察的卓越能力而日益受到工业界和学术界的广泛关注。数据查询构建是某些声明式可视化语言(如Vega-Lite、EChart等)的关键流程。自然语言处理技术的进步简化了通过自然语言界面实现表格数据可视化的过程,提供了更易用、更直观的用户体验。然而,当前将自然语言问题转换为数据可视化查询的方法(如Seq2Vis、ncNet和RGVisNet),尽管采用了复杂的神经网络架构,仍与预期存在差距,且具有极大的改进空间。ChatGPT和GPT-4等大语言模型已在多项自然语言处理任务中树立了新标杆,从根本上改变了该领域的研究格局。受这些进展启发,我们提出了名为Prompt4Vis的新型框架,利用大语言模型和上下文学习来提升从自然语言生成数据可视化的性能。Prompt4Vis包含两个核心组件:(1)多目标示例挖掘模块,旨在发现真正有效的示例,以强化大语言模型在文本到可视化任务中的上下文学习能力;(2)模式过滤模块,用于简化数据库模式。通过在NVBench数据集上进行的五折交叉验证实验表明,Prompt4Vis具有卓越性能,其在开发集和测试集上分别比当前最先进的RGVisNet方法高出约35.9%和71.3%。据我们所知,Prompt4Vis是首个将上下文学习引入文本到可视化任务以生成数据可视化查询的工作。