遇见数据集

SINAI/ALIA-es-legal-administrative-cqa

收藏
Hugging Face2026-05-27 更新2026-06-14 收录
官方服务:

资源简介:

--- license: cc-by-sa-4.0 task_categories: - question-answering - text-generation language: - es tags: - legal - administrative - Spanish - BOJA - question-answering - context-qa size_categories: - 1K<n<10K configs: - config_name: default data_files: - split: boja path: "boja.parquet" - split: parlamint_es_an path: "parlamint_es_an.parquet" --- # Dataset Introduction The **ALIA Spanish Legal and Administrative for Context Question Answering Corpus** is a specialized question-answering resource derived from the [SINAI/ALIA-es-legal-administrative](https://huggingface.co/datasets/SINAI/ALIA-es-legal-administrative) corpus. This dataset transforms legal and administrative documents into structured question-answer pairs, enabling the development and evaluation of AI systems capable of understanding and responding to queries about Spanish legal-administrative content. With **17,668 structured instances** extracted from official Spanish documentation, this dataset supports research in legal question answering, information retrieval, and the development of specialized language models for the Spanish legal-administrative domain. ## Dataset Details ### Dataset Description The **ALIA Spanish Legal and Administrative Context Question Answering Dataset** is an open-access resource that provides structured question-answer pairs based on official Spanish legal-administrative documents. Its purpose is to enable the development and evaluation of question-answering systems specialized in Spanish legal and administrative language, facilitating both research in natural language processing and the creation of practical tools for citizens, legal professionals, and public administration practitioners. This dataset has been designed to cover diverse information needs from multiple user perspectives, including legal professionals (judges, lawyers), government officials, business owners, urban planners, educators, and citizens. Each instance consists of a passage extracted from an official document, along with synthetically generated questions, answers, character personas, and difficulty levels that reflect realistic information needs. The dataset, with **17,668 question-answer pairs** derived from **6,740 unique documents** from the Boletín Oficial de la Junta de Andalucía (BOJA) and the Parlamento de Andalucía (ParlaMint-ES-AN), represents a valuable resource for evaluating AI systems in the Spanish legal-administrative domain. The synthetic generation methodology, based on techniques from the Qwen3 Embeddings paper, ensures consistency and scalability in creating high-quality evaluating data. ### Dataset Sources - **Base Corpus:** [ALIA Spanish Legal and Administrative Corpus](https://huggingface.co/datasets/SINAI/ALIA-es-legal-administrative) - **Methodology Reference:** [Qwen3 Embeddings Paper](https://arxiv.org/abs/2506.05176) - **Synthetic Generation Model:** [GPT-OSS-20B](https://huggingface.co/openai/gpt-oss-20b) ### Uses The primary purpose of this dataset is to serve as a foundation for evaluating question-answering systems specialized in the Spanish legal-administrative domain, with applications in: - Research in natural language processing applied to the legal-administrative domain. - Building AI assistants for citizens and professionals to understand Spanish regulations. - Benchmarking synthetic data generation methodologies for specialized domains. - Evaluating legal-administrative information retrieval systems. ## Dataset Structure ### Data Instances Each instance in the corpus has the following structure: ```json { "id_chunk": "Boletin_Oficial_Junta_Andalucia-BOJA-2016-Boletin-105-Seccion-8-Decreto-55-410485", "id_document": "BOJA-2016-Boletin-105-Seccion-8-Decreto-55", "passage": "5. Las instalaciones y las lagunas de secado contarán con barrera vegetal para mitigar el impacto visual desde los núcleos de población, carreteras y ferrocarril. Artículo 311. Condiciones Particulares de Edificación de las instalaciones anejas a la explotación de recursos mineros...", "question": "¿Qué requisitos de construcción y distancia deben cumplirse para instalaciones mineras de pequeña escala según la Ley 7/1994?", "answer": "Según la Ley 7/1994 y los artículos 311 y 312, las instalaciones mineras de pequeña escala deben cumplir los siguientes requisitos de construcción y distancia: 1) Separación de 250 metros de cualquier otra edificación...", "character": "small-scale miner", "difficulty": "university" } ``` ### Data Fields - **id_chunk** (string): Unique identifier for the specific chunk/passage within the source document. - **id_document** (string): Identifier of the source document from which the passage is extracted. - **passage** (string): The context text from the legal-administrative document that contains information relevant to the question (extracted from the original ALIA-legal-administrative corpus). - **question** (string): A synthetically generated question about the information contained in the passage. - **answer** (string): A synthetically generated comprehensive answer to the question based on the passage content. - **character** (string): A synthetically generated persona or user type for whom the question is relevant (e.g., "policy advisor", "district court judge", "local journalist"). - **difficulty** (string): A synthetically generated complexity level of the question-answer pair (e.g., "university", "high_school", "phd"). ### Data Splits The complete dataset contains **17,668 question-answer pairs** from official Spanish legal-administrative sources with the following statistics: | Metric | Value | |--------|-------| | Total QA Pairs | 17,668 | | Unique Documents | 6,740 | | Sources | Boletín Oficial de la Junta de Andalucía (BOJA), ParlaMint-ES-AN | | Average Passage Length | 2,978 characters | | Average Question Length | 108 characters | | Average Answer Length | 592 characters | The dataset is organized into **two splits**: #### Split: `boja` - **9,776 QA pairs** from Boletín Oficial de la Junta de Andalucía. - **6,474 unique documents** - Focus: Official legislation, regulations, and administrative acts. - Average passage length: 2,932 characters. - Average answer length: 613 characters. #### Split: `parlamint_es_an` - **7,892 QA pairs** from Parliament of Andalusia proceedings. - **266 unique documents**. - Focus: Parliamentary debates, speeches, and legislative discussions. - Average passage length: 3,034 characters. - Average answer length: 565 characters. #### Source Distribution | Source | Split | Count | Percentage | |--------|-------|-------|------------| | Boletin_Oficial_Junta_Andalucia | boja | 9,776 | 55.3% | | ParlaMint-ES-AN | parlamint_es_an | 7,892 | 44.7% | | **TOTAL** | - | **17,668** | **100%** | #### Character/Persona Distribution (Top 10) | Character | Count | |-----------|-------| | Policy Advisor | 320 | | Government Official | 220 | | Human Resources Manager | 204 | | Policy Analyst | 199 | | Constitutional Law Expert | 163 | | District Court Judge | 145 | | Health Policy Analyst | 138 | | Local Journalist | 135 | | Public Administration Expert | 127 | | City Council Member | 123 | #### Difficulty Distribution | Difficulty Level | Count | Percentage | |-----------------|-------|------------| | University | 16,550 | 93.7% | | High School | 994 | 5.6% | | PhD | 102 | 0.6% | | Other levels | 22 | 0.1% | ### Example Usage To load the dataset: ```python from datasets import load_dataset # Load the complete dataset dataset = load_dataset("SINAI/ALIA-es-legal-administrative-cqa") # Load specific split boja_dataset = load_dataset("SINAI/ALIA-es-legal-administrative-cqa", split="boja") parlamint_dataset = load_dataset("SINAI/ALIA-es-legal-administrative-cqa", split="parlamint_es_an") # Load with streaming (recommended for iterative processing) dataset = load_dataset("SINAI/ALIA-es-legal-administrative-cqa", streaming=True) ``` Example of data access: ```python # Access an example from BOJA split example = dataset['boja'][0] print(f"Question: {example['question']}") print(f"Passage: {example['passage'][:200]}...") print(f"Answer: {example['answer'][:200]}...") print(f"Character: {example['character']}") print(f"Difficulty: {example['difficulty']}") # Access an example from ParlaMint-ES-AN split parlamint_example = dataset['parlamint_es_an'][0] print(f"Question: {parlamint_example['question']}") print(f"Document ID: {parlamint_example['id_document']}") # Filter by difficulty level university_questions = [ex for ex in dataset['boja'] if ex['difficulty'] == 'university'] # Filter by character type judge_questions = [ex for ex in dataset['boja'] if 'judge' in ex['character'].lower()] # Compare both sources print(f"BOJA instances: {len(dataset['boja'])}") print(f"ParlaMint instances: {len(dataset['parlamint_es_an'])}") ``` ## Dataset Creation ### Curation Rationale This dataset was created to address the critical need for high-quality, scalable evaluating data for Spanish legal-administrative question-answering systems. Traditional approaches to creating QA datasets require extensive manual annotation by domain experts, which is time-consuming and expensive, particularly in specialized domains like legal text. By leveraging synthetic data generation techniques inspired by the Qwen3 Embeddings paper methodology, this dataset provides: - **Scalability**: Efficient generation of large-scale QA pairs without extensive manual annotation. - **Consistency**: Systematic coverage of diverse legal topics and user perspectives. - **Cost-Effectiveness**: Reduced annotation costs while maintaining quality. - **Domain Specialization**: Focus on Spanish legal-administrative language and concepts. - **Evaluation Resources**: Structured data for benchmarking legal QA systems. - **Dual Perspectives**: Coverage of both formal legislation (BOJA) and parliamentary discourse (ParlaMint-ES-AN). The inclusion of both BOJA documentation and ParlaMint-ES-AN proceedings ensures comprehensive coverage of Andalusian regional legislation, administrative procedures, and legislative debates, representing a significant portion of the regulatory framework and political discourse that affects citizens and businesses in Andalusia. ### Source Data The passages in this dataset are extracted directly from the [ALIA Spanish Legal and Administrative Corpus](https://huggingface.co/datasets/SINAI/ALIA-es-legal-administrative), specifically from two main sources: #### Official Bulletins - **Boletin_Oficial_Junta_Andalucia (BOJA)**: Andalusian regional legislation, covering areas such as urban planning, education, health, environment, labor, agriculture, industry, and public administration. - **Current version**: 9,776 QA pairs from BOJA documents. - 6,474 unique documents. - All passages extracted from the BOJA portion of the ALIA-legal-administrative corpus. #### Parliamentary Proceedings - **ParlaMint-ES-AN**: Parliamentary proceedings from the Parliament of Andalusia (1982-2025), including debates, speeches, interventions, and legislative discussions. - **Current version**: 7,892 QA pairs from ParlaMint-ES-AN documents - 266 unique documents (parliamentary sessions). - Passages extracted from the ParlaMint-ES-AN portion of the ALIA-legal-administrative corpus. All source passages come from official and publicly accessible documents available through: - BOJA: [https://www.juntadeandalucia.es/eboja](https://www.juntadeandalucia.es/eboja) - Parliament of Andalusia: [https://www.parlamentodeandalucia.es/](https://www.parlamentodeandalucia.es/) ### Data Collection and Processing The dataset was created through a systematic synthetic generation pipeline: 1. **Passage Extraction**: Text passages were extracted from the ALIA-legal-administrative corpus, maintaining document context and structure. 2. **Synthetic Generation**: Using GPT-OSS-20B following the methodology from the Qwen3 Embeddings paper, the following elements were generated for each passage: - Question: Realistic information queries relevant to the passage content. - Answer: Comprehensive responses grounded in the passage. - Character: User personas representing different stakeholder types. - Difficulty: Complexity level assessment. 3. **Quality Assurance**: Generated instances were filtered for: - Minimum and maximum length thresholds. - Coherence between question, passage, and answer. - Diversity of question types and personas. 4. **Split Organization**: Instances were organized into two splits (boja and parlamint_es_an) based on source document type. ### Annotations All annotations in this dataset are **synthetically generated** rather than manually created. This includes: #### Synthetic Annotations **1. Question (Synthetic)** - Generated by GPT-OSS-20B to represent realistic information needs. - Designed to span various complexity levels and question types. - Grounded in the content of the source passage. - Average length: 108 characters. **2. Answer (Synthetic)** - Generated by GPT-OSS-20B based on passage content. - Aims for comprehensiveness and legal accuracy. - Maintains consistency in style and quality across the dataset. - Average length: 592 characters. **3. Character/Persona (Synthetic)** - Automatically assigned to represent diverse user types. - Categories include: - **Legal professionals**: district court judge, lawyer, attorney, constitutional law expert. - **Government officials**: policy advisor, government official, city planner, policy analyst. - **Business stakeholders**: entrepreneur, business owner, company director, real estate developer. - **Technical professionals**: urban planner, architect, engineer, construction company owner. - **Citizens and community**: local journalist, city council member, mayor, resident. - **Health and education**: health policy analyst, university admissions officer, teacher. - Enables development of persona-specific QA systems. - Total unique personas: 320+ different character types. **4. Difficulty Level (Synthetic)** - Automatically classified based on legal concept complexity. - Distribution: - **University (93.7%)**: Requires higher education-level comprehension. - **High School (5.6%)**: Accessible to secondary education-level understanding. - **PhD (0.6%)**: Requires advanced specialized legal knowledge. - **Other levels (0.1%)**: Additional granular classifications. **Important Note**: All questions, answers, character assignments, and difficulty levels are synthetically generated. Users should be aware that these are not human-annotated and may require additional validation for critical applications. ### Personal and Sensitive Information The dataset maintains the same privacy standards as the source [ALIA Spanish Legal and Administrative Corpus](https://huggingface.co/datasets/SINAI/ALIA-es-legal-administrative): - **Source Passages**: Extracted from publicly accessible official BOJA and ParlaMint-ES-AN publications. - **Data Protection**: Personal data in source documents has been handled according to Spanish and EU data protection regulations (GDPR/RGPD). - **Official Context**: References to individuals typically appear only in official contexts (legislators, public officials in official capacities). - **Parliamentary Records**: ParlaMint-ES-AN contains names of parliamentarians and public officials as part of the official parliamentary record. - **Synthetic Generation**: The question-answer generation process does not introduce additional personal information beyond what exists in the source passages. - **User Responsibility**: Users are advised to apply appropriate safeguards depending on the specific use of the dataset. ### Citation ```bibtex @misc{ALIA-es-legal-administrative-cqa, title={ALIA Spanish Legal and Administrative for Context Question Answering Corpus}, author={SINAI Research Group}, year={2026}, publisher={HuggingFace}, howpublished={\url{https://huggingface.co/datasets/SINAI/ALIA-es-legal-administrative-cqa}} } ``` --- ## Funding This work is funded by the Ministerio para la Transformación Digital y de la Función Pública - Funded by EU – NextGenerationEU within the framework of the project [ALIA](https://alia.gob.es). ### Acknowledgments This dataset has been generated thanks to [SCAYLE](https://www.scayle.es/) (Centro de Supercomputación de Castilla y León) which provided the needed computational resources on its CALENDULA supercomputing cluster. --- **Contact:** [ALIA Project](https://www.alia.gob.es/) - [SINAI Research Group](https://sinai.ujaen.es) - [Universidad de Jaén](https://www.ujaen.es/) **More Information:** [SINAI Research Group](https://sinai.ujaen.es) | [ALIA-UJA Project](https://github.com/SINAI/ALIA-UJA)

The ALIA Spanish Legal and Administrative for Context Question Answering Corpus is a specialized question-answering resource derived from the SINAI/ALIA-es-legal-administrative corpus. This dataset transforms legal and administrative documents into structured question-answer pairs, enabling the development and evaluation of AI systems capable of understanding and responding to queries about Spanish legal-administrative content. With 17,668 structured instances extracted from official Spanish documentation, this dataset supports research in legal question answering, information retrieval, and the development of specialized language models for the Spanish legal-administrative domain. The dataset is designed to cover diverse information needs from multiple user perspectives, including legal professionals (judges, lawyers), government officials, business owners, urban planners, educators, and citizens. Each instance consists of a passage extracted from an official document, along with synthetically generated questions, answers, character personas, and difficulty levels that reflect realistic information needs. The dataset is based on two main sources: the Boletín Oficial de la Junta de Andalucía (BOJA) and the Parlamento de Andalucía (ParlaMint-ES-AN), containing 9,776 QA pairs from BOJA and 7,892 QA pairs from ParlaMint-ES-AN, totaling 6,740 unique documents. The synthetic generation methodology, based on techniques from the Qwen3 Embeddings paper, ensures consistency and scalability in creating high-quality evaluating data.

提供机构:
SINAI
搜集汇总
数据集介绍
SINAI/ALIA-es-legal-administrative-cqa 数据集图片
构建方式
该数据集立足于西班牙法律行政领域对高质量问答评估资源的迫切需求,以SINAI团队构建的ALIA西班牙法律行政语料库为根基,通过系统性合成生成流程加以构建。具体而言,首先从官方文献安达卢西亚自治区官方公报(BOJA)及安达卢西亚议会会议记录(ParlaMint-ES-AN)中抽取段落,保留原始文档语境与结构;继而借助GPT-OSS-20B模型,遵循Qwen3嵌入论文所阐述的方法论,为每个段落自动生成问题、答案、用户角色画像及难度等级;随后经过长度阈值、问题-段落-答案连贯性及类型多样性等多重质控筛选,最终依照来源文档类型划归为boja与parlamint_es_an两个数据子集,形成17,668条结构化问答实例。
特点
该数据集呈现出多维度、多视角的鲜明特征。其数据规模逾一万七千条问答对,源自6,740份唯一官方文档,涵盖正式立法与议会辩论双重来源,兼顾规范性文件与政治话语,覆盖面广泛。数据集包含段落、问题、答案、角色画像与难度等级五个核心字段,角色类型逾320种,囊括法官、律师、政策顾问、政府官员、企业家、城市规划师、记者、市民等多元利益相关方,能够支撑面向不同用户群体的问答系统开发。难度等级以大学水平为主,兼有高中与博士层级,呈现出合理的复杂度分层。此外,所有问答与标注均为合成生成,具有可扩展性与一致性优势,但亦提示使用者需注意其非人工标注之属性。
使用方法
使用者可依托HuggingFace datasets库便捷地加载与调用本数据集。通过load_dataset函数指定数据集名称即可获取完整数据,亦可通过split参数分别加载boja或parlamint_es_an子集,或启用streaming模式进行流式迭代处理。加载后,可按索引访问单条实例,提取问题、段落、答案、角色及难度等字段;亦可依据难度等级或角色类型进行条件过滤,以构建特定评估子集。该数据集适用于西班牙法律行政领域问答系统的基准评测、合成数据生成方法论的验证、法律信息检索系统的评估,以及面向公民与专业人员的智能法律助手研发等多元场景。
背景与挑战
背景概述
西班牙法律行政领域的智能化信息处理长期受制于高质量问答资源的匮乏。2026年,由哈恩大学SINAI研究组依托ALIA项目构建的ALIA-es-legal-administrative-cqa数据集应运而生。该数据集根植于安达卢西亚官方公报与议会会议记录,借助合成生成技术将6,740份原始文档转化为17,668个结构化问答实例,核心研究问题在于如何以可扩展的方式为西班牙法律行政领域提供系统化、多视角的评测基准。其影响力体现在为法律问答、信息检索及领域专用语言模型的发展奠定了关键数据基础。
当前挑战
该数据集所面对的核心挑战在于法律行政领域问答本身的专业性与复杂性,具体表现为:法律条文与议会辩论中概念高度密集、语义歧义频发,对系统的深层语义理解与逻辑推理能力构成严峻考验;合成数据虽具可扩展性,却可能引入与真实用户信息需求分布之间的偏差,问答对的法律准确性与语境一致性仍需审慎校验;此外,如何平衡不同难度层级与多元用户角色的覆盖,并在隐私合规框架下处理议会记录中的个人信息,亦是构建过程中不可回避的技术与伦理难题。
常用场景
经典使用场景
在西班牙法律与行政问答领域,该数据集构筑了基于安达卢西亚官方公报(BOJA)与议会会议记录(ParlaMint-ES-AN)的结构化问答基准,涵盖1.7万余条问答对,每条均配有真实文本段落、合成问题、详尽答案、用户画像与难度等级。其经典用途在于训练与评测面向西班牙法律行政领域的上下文问答系统,使模型能够针对具体法规条文与议会辩论内容生成精准回应,同时支持基于人物角色与难度层次的细粒度分析,成为法律信息检索与生成任务的重要试验场。
解决学术问题
该数据集有效缓解了法律行政领域高质量问答数据稀缺且人工标注成本高昂的困局,通过合成生成管线实现了大规模、可扩展且保持一致性的评测资源构建。它回应了跨专业领域问答中角色多样性与难度分层不足的问题,为研究法律文本理解、信息检索与生成式问答系统提供了标准化基准,推动了西班牙语法律自然语言处理研究从通用语料向专业深度语料的范式转变。
衍生相关工作
该数据集直接衍生于ALIA西班牙法律行政语料库,并借鉴Qwen3嵌入论文的方法论,利用GPT-OSS-20B进行合成生成。围绕该资源,已催生一系列法律问答评测基准构建、合成数据质量验证及领域专用语言模型微调等经典工作,为西班牙语法律行政问答系统的可比性评估与持续优化奠定了数据基础,并激励后续研究探索跨语言与跨法域的法律问答迁移。
以上内容由遇见数据集搜集并总结生成
二维码
社区交流群
二维码
科研交流群
商业服务