用知识图谱和智能纠错,让企业员工能自然语言查数据。
Text-to-SQL for Enterprise Data Analytics
- 构建包含元数据与日志的知识图谱,按团队划分数据表
- 自动纠正语法错误,53%查询结果正确或接近正确
- 支持查数、写句、调试,适合产品/运营等非技术用户
大型语言模型虽推动了Text-to-SQL基准进展,但构建企业级解决方案仍具挑战。本文介绍LinkedIn内部聊天机器人实践,帮助产品经理、工程师及运营团队从动态数据湖中自助获取数据洞察。方法包括:首先,构建知识图谱,整合数据库元数据、历史查询日志、维基文档和代码,通过聚类识别各团队相关表;其次,开发Text-to-SQL代理,从知识图谱中检索并排序上下文,生成查询并自动修正幻觉与语法错误;第三,搭建交互式聊天机器人,支持数据发现、查询编写与调试,以富界面展示结果,促进持续对话。该系统每周活跃用户超300人,专家评估显示在内部基准上53%的响应正确或接近正确。消融实验揭示关键组件,为构建企业级Text-to-SQL系统提供可落地路径。
原文摘要 · Abstract (English)
The introduction of large language models has brought rapid progress on Text-to-SQL benchmarks, but it is not yet easy to build a working enterprise solution. In this paper, we present insights from building an internal chatbot that enables LinkedIn's product managers, engineers, and operations teams to self-serve data insights from a large, dynamic data lake. Our approach features three components. First, we construct a knowledge graph that captures up-to-date semantics by indexing database metadata, historical query logs, wikis, and code. We apply clustering to identify relevant tables for each team or product area. Second, we build a Text-to-SQL agent that retrieves and ranks context from the knowledge graph, writes a query, and automatically corrects hallucinations and syntax errors. Third, we build an interactive chatbot that supports various user intents, from data discovery to query writing to debugging, and displays responses in rich UI elements to encourage follow-up chats. Our chatbot has over 300 weekly users. Expert review shows that 53% of its responses are correct or close to correct on an internal benchmark set. Through ablation studies, we identify the most important knowledge graph and modeling components, offering a practical path for developing enterprise Text-to-SQL solutions.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。