arXiv:2507.02846cs.SEcs.CL2025-07中稿 · the 33rd IEEE Inte…被引 3

用自然语言生成代码,自动解析法律条文并提取合规要求

Legal Requirements Translation from Law

  • 基于文本蕴含与上下文学习生成可执行的法律代码
  • 在13个美国州级数据泄露通知法上准确率超89%
  • 适合法律科技、合规自动化领域的开发者和研究者

软件系统需符合法律法规,但小企业和初创公司缺乏法律专家,合规成本高。从法规中提取元数据以明确软件合规需求是关键步骤,但法律文本冗长复杂,自动化提取困难。现有方法未充分考虑元数据属性间的关联,且依赖人工标注或启发式机器学习,泛化能力差。本文提出一种基于文本蕴含与上下文学习的方法,自动生成可编码为Python代码的法律文本规范表示。该表示基于手动设计的Python类结构,作为领域特定元模型,捕捉结构与语义元数据及其相互关系,减少对大规模标注数据的依赖,并提升对新立法的适用性。我们在13个美国州级数据泄露通知法上评估,生成表示通过约89.4%的测试用例,精确率82.2,召回率88.7。

原文摘要 · Abstract (English)

Software systems must comply with legal regulations, which is a resource-intensive task, particularly for small organizations and startups lacking dedicated legal expertise. Extracting metadata from regulations to elicit legal requirements for software is a critical step to ensure compliance. However, it is a cumbersome task due to the length and complex nature of legal text. Although prior work has pursued automated methods for extracting structural and semantic metadata from legal text, key limitations remain: they do not consider the interplay and interrelationships among attributes associated with these metadata types, and they rely on manual labeling or heuristic-driven machine learning, which does not generalize well to new documents. In this paper, we introduce an approach based on textual entailment and in-context learning for automatically generating a canonical representation of legal text, encodable and executable as Python code. Our representation is instantiated from a manually designed Python class structure that serves as a domain-specific metamodel, capturing both structural and semantic legal metadata and their interrelationships. This design choice reduces the need for large, manually labeled datasets and enhances applicability to unseen legislation. We evaluate our approach on 13 U.S. state data breach notification laws, demonstrating that our generated representations pass approximately 89.4% of test cases and achieve a precision and recall of 82.2 and 88.7, respectively.

法律AI合规生成自然语言转代码

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