用自然语言自动生成数据库表结构,让非专业人士也能轻松建库。
Text2Schema: Filling the Gap in Designing Database Table Structures based on Natural Language
- 设计多智能体框架,模拟人工设计流程,分角色协作生成表结构。
- 在381个样本上验证,生成的表结构准确率显著优于现有方法。
- 适合无数据库背景的用户,配合Text2SQL可实现全流程自动化。
缺乏数据库背景的用户通常依赖文件系统或Excel管理数据,易造成冗余和不一致。关系型数据库虽功能强大,但需专业技能。现有Text2SQL研究均假设已有预设计的数据库模式,而实际中模式设计本身需要领域知识,直接从文本需求生成模式的研究仍属空白。本文首次系统定义了Text2Schema任务:将自然语言需求转化为关系型数据库模式。为此提出SchemaAgent——基于大模型的多智能体框架,通过赋予各智能体专业化角色并实现协作,模拟人工设计流程,并引入反思与检查机制及创新的错误检测与修正策略。同时构建并开源包含381对需求描述与对应模式的基准数据集。实验表明,该方法在准确性上优于对比方案。
原文摘要 · Abstract (English)
People without a database background usually rely on file systems or tools such as Excel for data management, which often lead to redundancy and data inconsistency. Relational databases possess strong data management capabilities, but require a high level of professional expertise from users. Although there are already many works on Text2SQL to automate the translation of natural language into SQL queries for data manipulation, all of them presuppose that the database schema is pre-designed. In practice, schema design itself demands domain expertise, and research on directly generating schemas from textual requirements remains unexplored. In this paper, we systematically define a new problem, called Text2Schema, to convert a natural language text requirement into a relational database schema. With an effective Text2Schema technique, users can effortlessly create database table structures using natural language, and subsequently leverage existing Text2SQL techniques to perform data manipulations, which significantly narrows the gap between non-technical personnel and highly efficient, versatile relational database systems. We propose SchemaAgent, an LLM-based multi-agent framework for Text2Schema. We emulate the workflow of manual schema design by assigning specialized roles to agents and enabling effective collaboration to refine their respective subtasks. We also incorporate dedicated roles for reflection and inspection, along with an innovative error detection and correction mechanism to identify and rectify issues across various phases. Moreover, we build and open source a benchmark containing 381 pairs of requirement description and schema. Experimental results demonstrate the superiority of our approach over comparative work.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。