arXiv:2502.11201cs.DBcs.AI2025-02

让自然语言直接查询NoSQL数据库,解决文档型数据的复杂结构理解问题。

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

  • 提出TEND基准,基于真实MongoDB数据构建1210个可执行任务
  • 新模型SAG通过文档证据推理路径与值,提升查询准确性
  • 验证大模型在无模式数据上表现下降,凸显该任务独特挑战

NoSQL数据库是核心数据基础设施,但自然语言访问仍不成熟:正确生成查询需理解非关系型数据模型中的实体、嵌套路径、数组、缺失字段和动态键。本文研究将自然语言转化为NoSQL查询(Text-to-NoSQL),以MongoDB聚合管道在无模式文档存储中实现。提出TEND(Text-to-NoSQL Dataset)基准,包含1,210个原生MongoDB任务,覆盖11个数据库。其数据库环境由专家手动定义集合边界、嵌套数组、可选与稀疏路径、多态结构及动态键规范,并使用真实数据填充,经冻结的MongoDB执行验证,确保评估的是无模式文档推理而非SQL到MQL迁移。进一步提出SAG(Schema-as-Data Grounding)求解器,在有限的MQL生成前,从存储文档中推断路径与值,结合执行验证修复与结果一致性筛选。评估采用列容忍执行准确率(EXC)为主指标,辅以分级结果集F1和互斥执行结果分解。实验表明,具备强自然语言转SQL能力的大模型在TEND上表现显著下降,验证了文本转NoSQL作为独立的无模式文档推理问题。

原文摘要 · Abstract (English)

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.

自然语言查询NoSQL文本转查询MongoDB

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。