用大模型自动写可视化代码,能自我纠错并成功生成正确脚本。
ChatVis: Automating Scientific Visualization with a Large Language Model
- 用户用自然语言描述需求,模型逐步生成并修正Python代码。
- 在5个标准场景中全部正确执行,而其他大模型无辅助时全失败。
- 适合科研人员快速生成可运行的数据可视化代码。
我们开发了一个名为ChatVis的迭代式助手,利用大语言模型(LLM)自动生成用于数据分析和可视化的Python脚本。用户以自然语言指定操作,系统尝试生成对应脚本,并在执行出错时提取错误信息,引导模型修正,直至代码正确运行。该方法在五个典型可视化场景中均成功生成正确脚本,结果与真实答案一致。与多个未经辅助的大语言模型相比,所有未加协助的模型均未能生成正确脚本。代码已开源:https://github.com/tanwimallick/ChatVis/。
原文摘要 · Abstract (English)
We develop an iterative assistant we call ChatVis that can synthetically generate Python scripts for data analysis and visualization using a large language model (LLM). The assistant allows a user to specify the operations in natural language, attempting to generate a Python script for the desired operations, prompting the LLM to revise the script as needed until it executes correctly. The iterations include an error detection and correction mechanism that extracts error messages from the execution of the script and subsequently prompts LLM to correct the error. Our method demonstrates correct execution on five canonical visualization scenarios, comparing results with ground truth. We also compared our results with scripts generated by several other LLMs without any assistance. In every instance, ChatVis successfully generated the correct script, whereas the unassisted LLMs failed to do so. The code is available on GitHub: https://github.com/tanwimallick/ChatVis/.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。