
This repository contains the replication package and source code for the tool Reg2Req, accompanying the paper titled 'From Regulation to Requirements: An Automated Requirement Derivation and Explanation Pipeline'. The deposit consists of three files: the tool source code (reg2req.zip), all pipeline outputs, ground truth datasets, and user study materials (data.zip), and the complete set of LLM prompts used across all pipeline stages and supporting features (feature_prompts.xlsx). File Overview File Size Description reg2req.zip 1.77 MB Complete Reg2Req source code data.zip 2.30 MB Pipeline outputs, ground truth datasets, and user study materials feature_prompts.xlsx 8.33 KB LLM prompt reference table 1. reg2req.zip — Tool Source Code Unzips to a reg2req/ folder. Requires Python 3.9+ and an OpenAI API key to run the live pipeline. Module Structure Module Description app.py Streamlit application with five tabs: Clauses, Requirements, Definitions, Traceability Matrix, Export pipeline/preprocessor.py Stage 0: Parses EUR-Lex HTML into Clause objects pipeline/identifier.py Stage 1: GPT-5 clause identification with justification pipeline/derivator.py Stage 2: GPT-5 requirement derivation with explanations and cross-references tools/classifier.py FR/NFR classification tools/usecase.py Use case seed generation tools/definitions.py Term definition extraction tools/traceability.py Bidirectional traceability matrix builder utils/config.py Configuration loaded from environment variables utils/loader.py Loads pre-computed outputs from data/ when no API key is present utils/export.py Multi-sheet Excel export of all pipeline outputs models/clause.py Clause dataclass models/requirement.py Requirement and CrossReference dataclasses Running the Application cd reg2reqpip install -r requirements.txt # Optional: set API key to run the live pipelineecho "OPENAI_API_KEY=sk-..." > .env # Launch the Streamlit appstreamlit run app.py Detailed instructions are provided in the README.MD file in the reg2req\ folder. Without an API key, the application automatically switches to Load from Excel mode and serves the pre-computed results. 2. data.zip — Pre-Computed Pipeline Outputs and Datasets Unzips to a data/ folder with seven subfolders. ClauseID follows the format -- (e.g., GDPR-5-1, EUAI-10-3). Full requirement IDs are constructed as - (e.g., GDPR-5-1-R2). 1. data/clauses/ Raw parsed clauses extracted from EUR-Lex HTML. Files: gdpr_clauses.xlsx, euai_clauses.xlsx 2. data/clause_identification/ GPT-5 predictions and human-annotated ground truth for requirement-bearing clause identification. Files: gdpr_requirement_bearing_pred.xlsx, euai_requirement_bearing_pred.xlsx, gdpr_requirement_bearing_ground_truth.xlsx, euai_requirement_bearing_ground_truth.xlsx 3. data/requirement_derivation/ Derived requirements with plain-language explanations, typed cross-references, and LLM-as-judge evaluation scores. Files: gdpr_derived_requirements_with_refs.xlsx, euai_derived_requirements_with_refs.xlsx, gdpr_llm_judge_results.xlsx, euai_llm_judge_results.xlsx 4. data/FR_NFR_classification/ GPT-5 FR/NFR predictions and human-annotated ground truth labels. Files: gdpr_FR_NFR_pred.xlsx, euai_FR_NFR_pred.xlsx, gdpr_FR_NFR_ground_truth.xlsx, euai_FR_NFR_ground_truth.xlsx 5. data/use_case_seeds/ GPT-5-generated partial use case seeds for each derived requirement. Files: GDPR_use_cases.xlsx, EUAI_use_cases.xlsx 6. data/definitions/ Regulatory term definitions extracted by GPT-5 from all clauses, in both Excel and JSON formats. Files: gdpr_definitions.xlsx, gdpr_definitions.json, euai_definitions.xlsx, euai_definitions.json 7. data/user study/ User study materials for RQ4 and RQ5. Files: Reg2Req User Study - Google Forms.pdf (complete questionnaire as administered), Reg2Req User Study (Responses).xlsx (anonymised participant responses, n = 25) Timestamps, tool names, and any potentially identifying content in free-text responses have been redacted. 3. feature_prompts.xlsx — Prompt Reference Table An Excel file listing the system prompt and user prompt template used in each pipeline stage and supporting feature. Columns: Feature, System Prompt, User Prompt
| selected citations These citations are derived from selected sources. This is an alternative to the "Influence" indicator, which also reflects the overall/total impact of an article in the research community at large, based on the underlying citation network (diachronically). | 0 | |
| popularity This indicator reflects the "current" impact/attention (the "hype") of an article in the research community at large, based on the underlying citation network. | Average | |
| influence This indicator reflects the overall/total impact of an article in the research community at large, based on the underlying citation network (diachronically). | Average | |
| impulse This indicator reflects the initial momentum of an article directly after its publication, based on the underlying citation network. | Average |
