发表机构
University of Bari Aldo Moro(巴里阿尔多·莫罗大学)
机构由 AI 辅助整理,请以论文原文为准。AI 中文总结
PyKEEN-NSX是PyKEEN的扩展框架,可模块化开发静态、动态等负采样方法,兼容PyKEEN工作流,经4个数据集验证其负采样可用性相关特性。
AI 中文摘要
嵌入方法因其在知识图谱(KG)的链接预测和/或三元组分类任务上的可扩展性而受到广泛应用。嵌入模型的训练依赖于三元组的正样本和负样本,但由于KG通常仅包含正断言,负样本需通过负采样策略人工生成,这类策略从简单的随机破坏到利用结构、语义或嵌入信息的更复杂方法不等。高级负采样器的设计与实现仍具挑战性,因为多数流行的知识图谱嵌入(KGE)库仅支持基础策略,缺乏用于开发更高级定制化解决方案的统一框架。为解决这一缺口,我们推出PyKEEN-NSX,它是流行KGE框架PyKEEN的扩展,为负采样提供模块化工程抽象。该架构将候选负样本池的生成(依赖显式上下文)与选择策略分离,支持在统一框架内开发和集成静态、模式感知及动态方法。基于此抽象,我们实现了6种负采样器,同时完全兼容现有PyKEEN工作流和流水线。作为概念验证,我们研究了4个数据集上的负样本可用性,结果显示受限样本池的数量常低于所需的负样本数量,因此编码的标准在很大程度上被用于补充样本的随机回退策略所替代。
英文摘要
Embedding methods have become popular due to their scalability on link prediction and/or triple classification tasks on Knowledge Graphs (KGs). Embedding models are trained relying on both positive and negative samples of triples. However, since KGs generally contain only positive assertions, negative samples are artificially generated through negative sampling strategies, ranging from simple random corruption to more sophisticated approaches that exploit structural, semantic, or embedding information. The design and implementation of advanced negative samplers remains challenging, as most popular Knowledge Graph Embedding (KGE) libraries provide support only for basic strategies and lack a unified framework for developing more advanced and customized solutions. To address this gap, we introduce PyKEEN-NSX, an extension of PyKEEN, the popular KGE framework, that provides a modular engineered abstraction for negative sampling. The proposed architecture separates the generation of candidate negative pools, conditioned on an explicit context, from the selection strategy, enabling the development and integration of static, schema-aware and dynamic approaches within a consistent framework. Based on this abstraction, we implement six negative samplers, while remaining fully compatible with existing PyKEEN workflows and pipelines. As a proof of concept, we study negative availability across four datasets, showing that constrained pools frequently fall below the requested number of negatives, so that the encoded criterion is to a large extent replaced by the random fallback that supplements them.