TPSformer: knowledge graph representation learning with text and position structure for link prediction
摘要
Transformers, leveraging the powerful self-attention (SA) mechanism, effectively model long-range dependencies and complex relationships between elements, demonstrating outstanding performance in natural language tasks. However, when processing knowledge graph (KG) triples, they still face two major challenges: First, their vector representations often struggle to fully capture the fine-grained text semantic information inherent within triples. Second, the SA mechanism lacks explicit differentiation between the distinct roles of head, relation, and tail nodes within triples. In particular, due to structural limitations, the vanilla transformer struggles to model latent semantic and structural information directly between nodes. To address this, this paper proposes a transformer model that integrates text information with Positional Structure (TPSformer). This approach leverages the Pre-trained Language Model (PLM) to extract node text features, thereby better utilizing text semantic information within KG. Subsequently, we design a position-aware encoder that integrates textual features to enhance the SA mechanism’s modeling capability for relational semantics, enabling node representations to simultaneously incorporate textual and positional structural information. Experimental results on three real-world KG link prediction datasets demonstrate that by integrating text semantics and explicitly distinguishing the positional roles of nodes within triples, our method more effectively captures complex semantic relationships between entities and relations. Our approach significantly improves link prediction performance, outperforming current state-of-the-art models.