arXiv:2608.09028cs.AIcs.CL2026-08

将机构政策自动转为机器可读的SHACL规则,无需重训练模型

PolicyKG: An Agentic LLM Pipeline for Translating Institutional Policies into SHACL Knowledge Graphs

  • 用LLM分句并转换为道义逻辑,通过词汇注册表对齐目标本体
  • 在1663条政策语句上达86.9%分类准确率,SHACL正确率达F1=0.866
  • 只需更换注册表即可适配新领域,适合合规自动化与知识图谱构建者

机构政策以自然语言存在,而合规检查系统需要机器可读的约束。当前仍依赖人工转换。PolicyKG实现了闭环:一个基于LLM的流水线,读取政策PDF,将每句话分类为义务、许可或禁止,将其提升为一阶道义逻辑,并生成SHACL约束。四个阶段在LangGraph状态机上运行,每阶段配有验证器。最关键的是语料适配器——一个YAML词汇注册表,将LLM谓词锚定到目标本体。换域只需替换注册表,无需重新训练模型。在亚洲理工学院政策与程序语料库(1,663句,443条规则)上,道义分类准确率达86.9%(Cohen's kappa = .709)。三位标注员对50条样本独立重标,一致度Fleiss' kappa = .844。69个形状子集的SHACL结构正确率F1 = .866。一阶逻辑路径覆盖79.2%规则,其余走自然语言到SHACL的备选路径。对全部443条规则进行高阶逻辑审计,自动化正则清单未发现异常,第一作者核查92例一阶逻辑备选案例也确认无误。该语料中高阶逻辑的真实上限95%置信区间为0.67%。此为单语料审计结果,非证明一阶逻辑足以涵盖所有政策。将AIT注册表替换为GDPR注册表,精确属性对齐从1/15提升至11/15(Fisher精确检验p < .001;Cohen's h = 1.53)。在LexDeMod租赁合同基准(N = 200)上,宏平均F1降至.370,因租赁文本使用“shall be entitled”表示许可,恰好是注册表切换所要修复的词汇错位。重复运行生成哈希一致的SHACL输出。

原文摘要 · Abstract (English)

Institutional policies stay in natural language while the systems that check compliance demand machine-readable constraints. Bridging that gap is still done by hand. PolicyKG closes the loop. It is an LLM pipeline that reads a policy PDF, classifies each sentence as an obligation, permission, or prohibition, lifts the label into first-order deontic logic, and emits SHACL constraints. Four stages run on a LangGraph state machine with per-stage validators. The piece that matters most is the Corpus Adapter: a YAML vocabulary registry that grounds LLM predicates in a target ontology. Retargeting to a new domain means swapping the registry, not retraining a model. On the Asian Institute of Technology Policies and Procedures corpus (1,663 sentences, 443 rules), PolicyKG reaches 86.9% deontic classification accuracy (Cohen's kappa = .709). Three annotators independently re-label a 50-item sample and agree at Fleiss' kappa = .844. SHACL shape correctness on a 69-shape subset is F1 = .866. The FOL path handles 79.2% of rules; the rest go through a direct NL-to-SHACL fallback. We audited every one of the 443 rules for second- or higher-order constructs. An automated regex checklist flagged none, and a first-author pass on the 92 FOL-fallback cases confirmed the same. The exact upper 95% Clopper-Pearson bound on the true HOL rate is 0.67%. This is an audit finding for one corpus, not a proof of FOL sufficiency for institutional policy. Swapping the AIT registry for a GDPR registry raises exact property alignment from 1/15 to 11/15 (Fisher's exact p < .001; Cohen's h = 1.53). On the LexDeMod lease-contract benchmark (N = 200), Macro F1 drops to .370 because lease English uses "shall be entitled" for permission -- exactly the vocabulary mismatch registry swap is meant to fix. Repeated runs produce hash-identical SHACL outputs.

知识图谱LLM应用合规自动化SHACL

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