Nevertheless, the aforementioned methods fail
to model the contextual information in entity neigh-
bors. In fact, the context of an entity preserves
specific structural and semantic information, and
link prediction task is essentially dependent on the
contexts related to specific entities and triples. Fur-
thermore, not much attention is paid to the diver-
sity of entity representations in different contexts,
which may often result in false predictions. Quan-
titatively, dataset FB15k has 14579 entities and
154916 triples, and the number of entities with
types is 14417 (98.89%). There are 13853 entities
(95.02%) that have more than two types, and each
entity has 10.02 types on average. For example,
entity Nicole Kidman in Figure 1has two different
types (Actress and Citizen), expressing different
semantics in two different contexts. Specifically,
the upper left in the figure describes the contextual
information in type level about "Awards and works
of Nicole Kidman as an actress". In this case, it is
well-founded that there exists a relation between
Nicole Kidman and 66
th
Cannes, and intuitively
the prediction of (Nicole Kidman, ?, Lane Cove
Public School) does not make sense, since there
is no direct relationship between type Actress and
type School. But considering that Nicole Kidman
is also an Australian citizen, it is hence reasonable
to conduct such a prediction.
We argue that the key challenge of preserving
contextual information in embeddings is how to
encapsulate complex contexts of entity neighbor-
hoods. Simply considering all information in the
subgraph of entities as the context may bring in
redundant and noisy information. Schema, as a
high-order meta pattern of KG, contains the type
constraint between entities and relations, and it can
naturally be used to capture the structural and se-
mantic information in context. As for the problem
of inconsistent entity representations, the diverse
representations of an entity are indispensable to
be considered in different contexts. As different
schema defines diverse type restrictions between
entities, it is able to preserve subtle and precise
semantic information in a specific context. Addi-
tionally, to yield consistent and robust entity repre-
sentations for each contextual semantics, entities
in contexts of the same schema are supposed to
contain similar features but disparate in different
contexts.
To tackle the aforementioned issues, inspired
by the advanced contrastive learning techniques,
we proposed a novel schema-augmented multi-
level contrastive learning framework to allow ef-
ficient link prediction in KGs. To tackle the in-
completeness problem of KG schema, we first ex-
tract and build a <head_type, relation, tail_type>
tensor from an input KG (Rosso et al.,2021)
to represent the high-order schema information.
Then, we design a multi-level contrastive learning
method under the guidance of schema. Specifically,
we optimize the contrastive learning objective in
contextual-level and global-level of our model sep-
arately. In the contextual-level, contrasting entities
within subgraphs of the same schema can learn se-
mantic and structural characteristics in a specific
context. In the global-level, differences and global
connections between contexts of an entity can be
captured via a cross-view contrast. Overall, we
exploit the aforementioned contrastive strategy to
obtain entity representations with structural and
high-order semantic information in the pre-train
phase and then fine-tune representations of entities
and relations to learn subtler knowledge of KG.
To summarize, we make three major contribu-
tions in this work as follows:
•
We propose a novel multi-level contrastive
learning framework to preserve contextual in-
formation in entity embeddings. Furthermore,
we learn different entity representations from
different contexts.
•
We design a novel approach to sample hard
negatives by utilizing KG schema as a prior
constraint, and perform the contrast estima-
tion in both contextual-level and global-level,
enforcing the embeddings of entities in the
same context closer while pushing apart enti-
ties in dissimilar contexts.
•
We conduct extensive experiments on four dif-
ferent kinds of knowledge graph datasets and
demonstrate that our model outperforms state-
of-the-art baselines on the link prediction task.
2 Related Work
2.1 KG Inference
To conduct inference like link prediction on in-
complete KG, most traditional methods enumerate
relational paths as candidate logic rules, including
Markov logic network (Richardson and Domin-
gos,2006), rule mining algorithm (Meilicke et al.,
2019) and path ranking algorithm (Lao et al.,2011).