arXiv:2604.26971cs.IR2026-04

统一评估自然语言生成的SPARQL查询,解决评测标准混乱问题

T2S-Metrics: Unified Library for Evaluating SPARQL Queries Generated From Natural Language

论文配图:T2S-Metrics: Unified Library for Evaluating SPARQL Queries Generated From Natural Language
图 1 · 摘自论文原文
  • 构建20+项指标的开源评估库,覆盖语法、语义、执行等多维度
  • 支持精确匹配、答案相似度、排名质量等10余种关键指标
  • 适合知识图谱问答系统开发者与评测研究者使用

知识图谱上的问答系统评估长期存在标准分散、不一致和可复现性差的问题。尽管语义解析与SPARQL查询生成取得进展,但评估方法仍多样且难以比较。现有基准通常仅关注查询精确匹配或答案层面的F1,忽略了语法正确性、语义忠实性、执行准确性、结果排序质量及计算效率。本文提出t2s-metrics,一个开源、可扩展、统一的评估库,专用于SPARQL查询的对比与基于执行的评估。该库包含超过20项指标,涵盖词法、语法、语义、结构、执行和排序等多个维度,如令牌级精确率、召回率、F1;BLEU、ROUGE、METEOR、CodeBLEU变体;变量归一化指标(SP-BLEU、SP-F1);基于图与URI的精确匹配;答案集指标如F1-QALD与杰卡德相似度;排序指标如MRR、NDCG、P@k、Hit@k;以及大模型作为评判者(LLM-as-a-Judge)的指标。受信息检索领域ir-metrics启发,t2s-metrics提供模块化抽象层,将指标定义与实现解耦,确保评估的一致性、透明性和可复现性。我们主张t2s-metrics是迈向知识图谱问答系统标准化评估的必要一步,有助于超越答案正确性,深入诊断系统行为。

原文摘要 · Abstract (English)

The evaluation of Question Answering (QA) systems over Knowledge Graphs has historically suffered from fragmentation, inconsistency, and limited reproducibility. While significant progress has been made in semantic parsing and SPARQL query generation, evaluation methodologies remain diverse, ad hoc, and often incomparable across studies. Existing benchmarks typically focus on a small subset of metrics, such as query exact match or answer-level F1, neglecting syntactic validity, semantic faithfulness, execution correctness, results ranking quality, and computational efficiency. In this paper, we present t2s-metrics, an open-source, extensible, and unified evaluation library designed specifically for SPARQL query comparison and execution-based assessment. t2s-metrics provides a broad and extensible set of over 20 evaluation metrics, collected from the literature and practical evaluation needs, spanning lexical, syntactic, semantic, structural, execution-based and ranking-based dimensions. These include query-based metrics such as token-level Precision, Recall, and F1; BLEU, ROUGE, METEOR, and CodeBLEU variants; variable-normalized metrics (SP-BLEU, SP-F1); graph-and URI-based exact match metrics; as well as answer set-based metrics such as F1-QALD and Jaccard similarity; ranking metrics including MRR, NDCG, P@k, and Hit@k; and LLM-as-a-Judge metrics. Taking inspiration from the ir-metrics library for Information Retrieval, t2s-metrics provides a modular abstraction layer that decouples metric specification from implementation, enabling consistent, transparent, and reproducible evaluation of SPARQLbased QA systems. We argue that t2s-metrics constitutes a necessary step toward systematic, standardized evaluation in question answering over knowledge graphs and facilitates deeper diagnostic insights into system behavior beyond answer correctness.

知识图谱自然语言查询评估指标SPARQL

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