arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2502.11201cs.DBcs.AI
收藏

弥合差距:通过文本到NoSQL翻译实现NoSQL数据库的自然语言查询

Bridging the Gap: Enabling Natural Language Queries for NoSQL Databases through Text-to-NoSQL Translation

University of Science and Technology of China(中国科学技术大学);Tsinghua University(清华大学);The University of Hong Kong(香港大学)

Jinwei Lu, Jiawei Lu, Chen Zhang, Zhiqian Qin, Haodi Zhang, Yuanfeng Song, Raymond Chi-Wing Wong

AI总结:

本文研究Text-to-NoSQL任务,提出TEND基准和SAG求解器,用于将自然语言请求翻译为MongoDB聚合管道,验证了无模式文档推理的独特挑战。

摘要:

NoSQL数据库是核心数据基础设施,但对其的自然语言访问仍不成熟:正确的查询生成必须恢复非关系数据模型如何表示实体、嵌套路径、数组、缺失字段和动态键。本文研究Text-to-NoSQL,将自然语言请求翻译为可执行的NoSQL查询,实例化为对无模式文档存储的MongoDB聚合管道。我们提出TEND(Text-to-NoSQL Dataset的缩写),一个执行验证的基准,包含11个数据库上的1,210个MongoDB原生任务。据我们所知,TEND是第一个数据库世界设计为MongoDB原生的Text-to-NoSQL基准:专家手动定义集合边界、嵌套数组、可选和稀疏路径、多态形状以及动态键约定;这些世界填充真实数据并通过冻结的MongoDB执行验证,因此TEND评估无模式文档推理而非SQL到MQL的迁移。我们进一步引入SAG(Schema-as-Data Grounding)求解器,该求解器在受限MQL生成、执行接地修复和结果一致性选择之前,从存储文档证据中诱导路径和值接地。评估使用受限列容忍执行准确率(EXC)作为主要指标,辅以分级结果集F1和互斥执行结果分解。实验表明,在NL2SQL上表现强劲的LLM在TEND上大幅下降,验证了Text-to-NoSQL作为一个独特的无模式文档推理问题。

英文摘要:

NoSQL databases are core data infrastructure, yet natural-language access to them remains underdeveloped: correct query generation must recover how a non-relational data model represents entities, nested paths, arrays, missing fields, and dynamic keys. This paper studies Text-to-NoSQL, translating natural-language requests into executable NoSQL queries, instantiated with MongoDB aggregation pipelines over schema-less document stores. We present TEND, short for Text-to-NoSQL Dataset, an execution-verified benchmark with 1,210 MongoDB-native tasks across 11 databases. To our knowledge, TEND is the first Text-to-NoSQL benchmark whose database worlds are MongoDB-native by design: experts manually define collection boundaries, nested arrays, optional and sparse paths, polymorphic shapes, and dynamic-key conventions; these worlds are populated with real data and verified through frozen MongoDB execution, so TEND evaluates schema-less document reasoning rather than SQL-to-MQL transfer. We further introduce SAG, a Schema-as-Data Grounding solver that induces path and value grounding from stored-document evidence before bounded MQL generation, execution-grounded repair, and result-consistency selection. Evaluation uses bounded column-tolerant execution accuracy (EXC) as the headline metric, complemented by a graded result-set F1 and a mutually exclusive execution-outcome decomposition. Experiments show that LLMs with strong NL2SQL performance degrade substantially on TEND, validating Text-to-NoSQL as a distinct schema-less document reasoning problem.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑