遇见数据集

SINAI/ALIA-es-cultural-heritage-triplets

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

资源简介:

--- language: - es license: cc-by-sa-4.0 size_categories: - 1M<n<10M tags: - cultural - heritage - humanities - retrieval - hard-negatives - embeddings - spanish task_categories: - text-generation - question-answering configs: - config_name: hard-negatives data_files: - split: train path: "ALIA-es-cultural-hard-negatives-train.parquet" - config_name: evaluation data_files: - split: test path: "ALIA-es-cultural-hard-negatives-eval.parquet" --- # Dataset Introduction The dataset **ALIA Spanish Cultural and Heritage Hard Negatives Corpus** contains **hard negatives for dense retrieval training** generated from <query, passage> pairs contained in [SINAI/ALIA-es-cultural-heritage-pairs](https://huggingface.co/datasets/SINAI/ALIA-es-cultural-heritage-pairs).\ The dataset was created as part of the **ALIA project** to improve the training of embedding models and dense retrievers specialized in Spanish cultural heritage language. Hard negatives are passages that are **semantically similar to a query but not correct answers**, making them particularly useful for training robust retrieval systems. Each query is paired with **multiple hard negatives** generated automatically using embedding similarity mining. This structure enables training retrieval models using contrastive or ranking losses that benefit from **multiple negatives per query**. The dataset was generated automatically using a **SentenceTransformers-based hard negative mining pipeline** with FAISS similarity search and the **Qwen3-Embedding-0.6B** embedding model. ------------------------------------------------------------------------ # Dataset Details ## Dataset Description The **ALIA Spanish Cultural and Heritage Hard Negatives Corpus** provides challenging negative passages for training dense retrieval models in the Spanish cultural heritage domain. In dense retrieval systems, hard negatives are passages that are **semantically close to the query but do not contain the correct answer**. Training with such negatives helps models learn fine‑grained semantic distinctions and improves ranking performance. This dataset is derived from cultural heritage query--passage pairs used within the ALIA project and automatically augmented with hard negatives using embedding similarity mining. ------------------------------------------------------------------------ # Dataset Structure The dataset has **two distinct configurations**, each with a different purpose and structure: ## Config 1: Hard Negatives (Training) **Purpose:** Multi-negative training for dense retrieval models. ### Data Instances Each training instance contains: - a **query** (in conversational format) - **one positive passage** (correct answer) - **multiple hard negative passages** mined from the corpus (typically 5 per query) - the **train phase** and **difficulty** label Example: ```json { "train_phase": "phase_1", "difficulty": "university", "messages": [ { "role": "user", "content": "¿Qué funciones sociales y comunicativas tiene el Toque Manual de Campanas declarado en 2019 y de qué manera se está protegiendo este patrimonio inmaterial en España?" } ], "positive_messages": [ [ { "role": "user", "content": "El Toque Manual de Campanas, declarado en 2019, es un lenguaje sonoro que ha funcionado a lo largo de los siglos como un medio de comunicación, cumpliendo un conjunto de funciones sociales para la comunidad: informar, coordinar, delimitar el territorio y proteger. ..." } ] ], "negative_messages": [ [ { "role": "user", "content": "En la campana se distinguen las siguientes inscripciones: ... Campana Wamba: Fundida en 1219, es la campana más antigua en funcionamiento de España. ..." } ], [ { "role": "user", "content": "Esto significa que a partir de ahora las declaraciones de bienes españoles se van a otorgar con cuenta gotas entre los bienes aprobados en la Lista Indicativa. ..." } ] ] } ``` ### Data Fields (Hard Negatives) | Field | Type | Description | | :--- | :--- | :--- | | **train_phase** | `string` | Phase label for training organization. | | **difficulty** | `string` | Difficulty level: `high_school`, `university`, or `phd`. | | **messages** | `list` | Query in conversational format (single message). | | **positive_messages** | `list` | List containing one positive passage in conversational format. | | **negative_messages** | `list` | List of hard negative passages in conversational format. | ## Config 2: Evaluation (Triplets) **Purpose:** Evaluation of retrieval models using query-passage-answer triplets. ### Data Instances Each evaluation instance is a **triplet** containing: - a **query** (plain text) - a **passage** (the retrieval candidate) - an **answer** (reference/expected answer for the query) - metadata: source, difficulty, character type, etc. Example: ```json { "dataset": "triplets_7275", "source_id": "Revista_Hipogrifo", "id_passage_query": "Revista_Hipogrifo-The_Topic_of_the_Jerusalem_War_in_Luis_de_Miranda_and_Martin_del_Barco_Centenera-13106_3", "character": "17th century Jesuit history researcher", "type": "background", "difficulty": "university", "query": "¿Qué papel desempeña el tema del asedio de Jerusalén en los textos coloniales tempranos del Río de la Plata y cómo lo expresan Luis de Miranda y Martín del Barco Centenera?", "id_passage": "Revista_Hipogrifo-The_Topic_of_the_Jerusalem_War_in_Luis_de_Miranda_and_Martin_del_Barco_Centenera-13106", "passage": "This analysis, whose point of departure is the discursive complexity of colonial productions... [full passage text]", "answer": "El análisis muestra que el asedio de Jerusalén, tomado de la obra de Flavio Josefo, se rearticula en la escena política colonial temprana del Río de la Plata..." } ``` ### Data Fields (Evaluation) | Field | Type | Description | | :--- | :--- | :--- | | **dataset** | `string` | Dataset identifier. | | **source_id** | `string` | Source repository of the document. | | **id_passage_query** | `string` | Unique identifier for the query-passage pair. | | **character** | `string` | Character or perspective for the query context. | | **type** | `string` | Type of query context (e.g., "background", "summary"). | | **difficulty** | `string` | Difficulty level: `high_school`, `university`, or `phd`. | | **query** | `string` | Plain text query. | | **id_passage** | `string` | Unique identifier for the passage. | | **passage** | `string` | The full passage text. | | **answer** | `string` | Reference answer or expected retrieval result. | ------------------------------------------------------------------------ # Example Usage The dataset can be loaded using the HuggingFace **datasets** library. ## Load All Configs ``` python from datasets import load_dataset # Load hard negatives (training) hard_neg_train = load_dataset("SINAI/ALIA-es-cultural-heritage-triplets", "hard-negatives") print(hard_neg_train["train"][0]) # Load evaluation triplets eval_triplets = load_dataset("SINAI/ALIA-es-cultural-heritage-triplets", "evaluation") print(eval_triplets["test"][0]) ``` ## Access Hard Negatives (Training Config) ``` python example = hard_neg_train["train"][0] query = example["messages"][0]["content"] positive = example["positive_messages"][0][0]["content"] negatives = [n[0]["content"] for n in example["negative_messages"]] print("Query:", query) print("Positive:", positive[:200]) print(f"Hard Negatives: {len(negatives)} passages") ``` ## Example for Contrastive Training ``` python query = example["messages"][0]["content"] positive = example["positive_messages"][0][0]["content"] negatives = [n[0]["content"] for n in example["negative_messages"]] training_example = { "query": query, "positive": positive, "negatives": negatives, "difficulty": example["difficulty"] } ``` This format can be used to train retrieval models such as: - SentenceTransformers dense retrievers with multi-negatives - dual‑encoder retrieval models - RAG retrievers with contrastive learning ## Access Evaluation Triplets ``` python example = eval_triplets["test"][0] query = example["query"] passage = example["passage"] answer = example["answer"] print("Query:", query) print("Passage:", passage[:200]) print("Expected Answer:", answer[:200]) ``` ## Example for Retrieval Evaluation ``` python eval_example = { "query": example["query"], "passage": example["passage"], "answer": example["answer"], "difficulty": example["difficulty"], "source": example["source_id"] } ``` This triplet format is suitable for: - Evaluating retrieval model ranking quality - Assessing passage-query relevance - Benchmarking dense retrieval systems # Difficulty Levels ## Motivation The inclusion of multiple difficulty levels is designed to improve the robustness and generalization of retrieval models. Different difficulty levels introduce variation in: - linguistic complexity - domain-specific terminology - reasoning depth required to distinguish correct vs incorrect passages ## Description of Each Level - **high_school**: Contains simpler queries with more explicit wording and lower semantic ambiguity. Negatives are easier to distinguish from the correct passage. - **university**: Includes moderately complex queries with more specialized vocabulary and increased semantic overlap between positives and negatives. - **phd**: Contains highly complex queries from the biomedical domain, often requiring fine-grained semantic understanding. Hard negatives in this setting are very close to the correct answer, making the retrieval task significantly more challenging. These levels correspond to the **complexity of the original query–passage pairs** from which hard negatives were generated and evaluation triplets selected. ## Training Implications Using multiple difficulty levels allows: - curriculum learning strategies (easy → hard) - more robust embedding models - evaluation across different complexity regimes This design is aligned with the hard negative mining pipeline. ------------------------------------------------------------------------ # Dataset Creation ## Hard Negative Mining Pipeline Hard negatives were generated using the SentenceTransformers utility: ``` python from sentence_transformers.util import mine_hard_negatives ``` Mining procedure: 1. Encode queries and passages with an embedding model 2. Build a FAISS similarity index 3. Retrieve semantically similar passages 4. Apply similarity filtering constraints 5. Select passages close to the query embedding but incorrect Two sampling selection strategies were used: * **Phase 1**: Randomly samples negatives from the candidate pool * **Phase 2**: Most similar negatives ------------------------------------------------------------------------ ## Embedding Model | Parameter | Value | |---------------------|---------------------------| | Model | Qwen3-Embedding-0.6B | | Framework | SentenceTransformers | | Similarity Search | FAISS | ------------------------------------------------------------------------ ## Mining Parameters ``` python mine_hard_negatives( dataset=hf_dataset, model=model, output_scores=True, range_min=10, range_max=50, max_score=0.8, relative_margin=0.05, num_negatives=5, batch_size=16, use_faiss=True, anchor_column_name="query", positive_column_name="passage" ) ``` ------------------------------------------------------------------------ # Statistics | Difficulty | Hard Negatives | Evaluation | | :--- | ---: | ---: | | **high_school** | 414,752 | 1,818 | | **university** | 766,416 | 3,660 | | **phd** | 202,704 | 1,084 | | **TOTAL** | **1,383,872** | **6,562** | ------------------------------------------------------------------------ ## Annotations No manual annotations exist. ## Personal and Sensitive Information The data comes from publicly available cultural heritage and institutional sources. Any personally identifiable information (if originally present) has been filtered in the pre-processing stages to ensure privacy and compliance. --- # Considerations for Using the Data ## Social Impact of Dataset Facilitates the development of cultural heritage encoders in Spanish, improving natural language processing and retrieval systems for heritage documentation, cultural information access, and digital humanities research. ## Discussion of Biases Reflects: - biases from heritage, institutional, and historical documentation, - inherent limitations of the generating model, ## Other Known Limitations - Interpretation of specialized heritage terminology may vary - Synthetic hard negatives may occasionally include factual heritage information that is plausible but technically incorrect for the specific query - Synthetic hard negatives may occasionally be semantically very close to the positive passage, making some examples especially challenging ## Citation ```bibtex @misc{ALIA-es-cultural-heritage-triplets, title={ALIA Spanish Cultural and Heritage Hard Negatives Corpus}, author={SINAI Research Group}, year={2026}, publisher={HuggingFace}, howpublished={\url{https://huggingface.co/datasets/SINAI/ALIA-es-cultural-heritage-triplets}} } ``` --- ### 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-uja/ALIA-UJA)

The ALIA Spanish Cultural and Heritage Hard Negatives Corpus is a dataset designed for training dense retrieval models in the Spanish cultural heritage domain. It contains hard negatives automatically generated from query-passage pairs in the SINAI/ALIA-es-cultural-heritage-pairs dataset. Hard negatives are passages that are semantically similar to a query but not correct answers, making them particularly useful for training robust retrieval systems. The dataset was created as part of the ALIA project to improve the training of embedding models and dense retrievers specialized in Spanish cultural heritage language. The dataset has two main configurations: the training configuration (hard-negatives) contains queries, one positive passage, multiple hard negative passages (typically 5 per query), along with train phase and difficulty labels; the evaluation configuration (evaluation) contains query-passage-answer triplets for evaluating retrieval models. The dataset includes three difficulty levels: high_school, university, and phd, corresponding to different levels of query complexity and semantic ambiguity. Data was generated automatically using a SentenceTransformers-based hard negative mining pipeline with the Qwen3-Embedding-0.6B embedding model and FAISS similarity search. In total, there are 1,383,872 hard negatives and 6,562 evaluation triplets.

提供机构:
SINAI
搜集汇总
数据集介绍
SINAI/ALIA-es-cultural-heritage-triplets 数据集图片
构建方式
该数据集立足于西班牙文化遗产领域中稠密检索模型训练的需求,以SINAI/ALIA-es-cultural-heritage-pairs中的查询—段落对为原始素材,借助基于SentenceTransformers的硬负例挖掘流水线自动构建。挖掘过程首先采用Qwen3-Embedding-0.6B嵌入模型对查询与段落进行向量化编码,继而构建FAISS相似度索引以检索语义相近的段落,并通过相似度过滤约束筛选出与查询语义接近但并非正确答案的段落作为硬负例,最终以对比学习与排序损失所需的格式加以组织,形成包含训练与评估两种配置的完整语料。
特点
该数据集在结构与内容层面均体现出鲜明的领域针对性与训练友好性。其训练配置以多负例形式呈现,每个查询配有约五个经由嵌入相似度挖掘获得的硬负例,并标注训练阶段与难度等级;评估配置则以查询—段落—答案三元组形式提供参考,涵盖高中、大学与博士三个难度层级,兼顾语言复杂度与语义区分深度。整体规模逾百万条,硬负例与评估样本按难度分层统计,为检索模型的鲁棒性与泛化能力评估提供了层次化支撑,其数据来源为公开的文化遗产与机构文档,预处理阶段已对个人可识别信息予以过滤。
使用方法
该数据集可通过HuggingFace datasets库便捷加载,用户分别指定hard-negatives与evaluation两种配置以获取训练与评估数据。训练配置中,可提取messages字段中的查询、positive_messages中的正例段落以及negative_messages中的多组硬负例,用于SentenceTransformers稠密检索器、双编码器检索模型或RAG检索器的对比学习与多负例训练;评估配置则通过query、passage、answer及难度、来源等元数据字段,支持检索排序质量评估、段落与查询相关性判断以及稠密检索系统的基准测试。难度分级亦为课程学习策略提供了由易到难的训练路径。
背景与挑战
背景概述
在西班牙文化遗产数字化保护与自然语言处理交汇的学术前沿,SINAI研究团队依托哈恩大学,于ALIA项目框架下构建了ALIA-es-cultural-heritage-triplets数据集,旨在为西班牙语文化遗产领域的稠密检索模型提供高质量的难负例训练资源。该数据集源自ALIA-es-cultural-heritage-pairs中的查询-段落对,通过自动化挖掘生成语义相近但非正确应答的段落,涵盖高中、大学及博士三级难度,总计逾一百三十八万训练样本与六千余评估三元组,显著推动文化遗产编码器与数字人文检索系统的发展。
当前挑战
在文化遗产检索领域,模型需精准辨析语义高度重叠的段落,而西班牙语文化遗产文本术语纷繁、历史语境复杂,这构成严峻的领域挑战。数据集构建过程中,自动化挖掘难负例面临采样策略平衡、相似度阈值设定及合成负例可能包含貌似合理却事实错误的遗产信息等难题,同时生成模型自身的局限亦可能引入偏差,确保负例的挑战性与准确性成为核心难点。
常用场景
经典使用场景
在西班牙文化遗产领域的密集检索模型训练中,该数据集凭借其精心构建的困难负样本,成为对比学习与排序学习的核心资源。每一条查询均配有多个语义邻近却非正确答案的段落,模型得以在细微语义差异中习得精准区分能力。研究者常将其用于训练基于SentenceTransformers的多负样本密集检索器、双编码器架构以及检索增强生成系统中的检索模块,从而在文化遗产问答与文本匹配任务上取得显著性能提升。
实际应用
在实际应用中,该数据集支撑了文化遗产数字档案的智能检索系统、面向公众的文化遗产问答平台以及学术文献的语义搜索工具。借助其训练的检索模型能够从海量西班牙语文化遗产文档中精准定位与用户查询相关的段落,显著提升文化机构、博物馆与图书馆的信息服务效率。同时,该数据集也为跨语言文化遗产检索迁移研究提供了宝贵的西班牙语基准资源,助力文化遗产知识的广泛传播与利用。
衍生相关工作
基于该数据集,研究者已衍生出多项经典工作,包括面向西班牙语文化遗产的专用嵌入模型微调、多负样本对比学习策略的优化以及检索增强生成系统在文化遗产领域的适配。这些工作进一步扩展了原始查询-段落对数据集的应用边界,形成了从困难负样本挖掘到检索模型评估的完整技术链条。相关成果亦被用于跨领域检索基准的构建与文化遗产知识图谱的链接预测任务,彰显了该数据集在学术与工程层面的持久影响力。
以上内容由遇见数据集搜集并总结生成
二维码
社区交流群
二维码
科研交流群
商业服务