Few-shot knowledge graph completion (FKGC) task aims to predict unseen facts of a relation with few-shot reference entity pairs. Current approaches randomly select one negative sample for each reference entity pair to minimize a margin-based ranking loss, which easily leads to a zero-loss problem if the negative sample is far away from the positive sample and then out of the margin. Moreover, the entity should have a different representation under a different context. To tackle these issues, we propose a novel Relation-Aware Network with Attention-Based Loss (RANA) framework. Specifically, to better utilize the plentiful negative samples and alleviate the zero-loss issue, we strategically select relevant negative samples and design an attention-based loss function to further differentiate the importance of each negative sample. The intuition is that negative samples more similar to positive samples will contribute more to the model. Further, we design a dynamic relation-aware entity encoder for learning a context-dependent entity representation. Experiments demonstrate that RANA outperforms the state-of-the-art models on two benchmark datasets.
翻译:小样本知识图谱补全任务旨在利用少量参考实体对预测某个关系的未知事实。当前方法为每个参考实体对随机选取一个负样本,以最小化基于边际的排序损失,但若负样本远离正样本并超出边际,则易导致零损失问题。此外,实体在不同上下文下应具有不同表示。为解决这些问题,我们提出了一种新颖的关系感知网络与注意力损失框架(RANA)。具体而言,为充分利用丰富负样本并缓解零损失问题,我们策略性地选取相关负样本,并设计了一种基于注意力的损失函数,以进一步区分各负样本的重要性。其直觉在于,与正样本更相似的负样本将对模型贡献更大。此外,我们设计了一种动态关系感知实体编码器,用于学习上下文相关的实体表示。实验表明,RANA在两个基准数据集上优于当前最优模型。