<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>TransHExt: a Weighted Extension for TransH on Weighted Knowledge Graph Embedding</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Kong Wei Kun</string-name>
          <email>kong.diison@jaist.ac.jp</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Xin Liu</string-name>
          <email>xin.liu@aist.go.jp</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Teeradaj Racharak</string-name>
          <email>racharak@jaist.ac.jp</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Le-Minh Nguyen</string-name>
          <email>nguyenml@jaist.ac.jp</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>STRING</string-name>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Artificial Intelligence Research Center, National Institute of Advanced Industrial Science and Technology</institution>
          ,
          <addr-line>AIST</addr-line>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>School of Information Science, Japan Advanced Institute of Science and Technology</institution>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2022</year>
      </pub-date>
      <fpage>23</fpage>
      <lpage>27</lpage>
      <abstract>
        <p>Many methods have been proposed for embedding ordinary knowledge graphs (KG), which greatly promote various applications. However, current knowledge graph embedding algorithms cannot encode weighted knowledge graphs (WKG), which are a generalized form of the ordinary KG. This paper gives a promising approach that enables to extend existing models to encode weighted knowledge graphs. Taking TransH as an example, we propose TransHExt. TransHExt shows competitive performance in both link prediction task and weight prediction task.</p>
      </abstract>
      <kwd-group>
        <kwd>weighted Knowledge graph embedding</kwd>
        <kwd>weighted extension</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>https://staff.aist.go.jp/xin.liu/ (X. Liu); https://sites.google.com/view/teeradaj (T. Racharak)
© 2022 Copyright for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0).</p>
    </sec>
    <sec id="sec-2">
      <title>1. WeExt: Weighted ETxratnesnHsEioxnt, FISrWa mCe2w02o2rk</title>
      <p>The framework of WeExt is shown in Figure 1. We introduce an add-on weight prediction
module consisting of preprocessing and a neural weight predictor (denoted by  
) to predict
the weight for a given triple. The preprocessing is defined as the scoring function of a base model
without the norm. We implement the neural weight predictor using a multi-layer feed-forward
neural network.</p>
      <p>base model</p>
      <p>weight prediction module
t
h
표푐 푠푠 훠
푤
푤</p>
      <p>훠ℎ
푢</p>
      <p>훠ℎ
푑 푐 표
푠푐표
푓푢 푐 표
훠</p>
      <p>푠푐표
embedded
relation
relation
embedding
entity
embedding
embed
tail entity
embedded
head entity
nents are the weight prediction component.</p>
      <p>The preprocessing of the embedded entity and relation vary to the scoring function  (⋅) of
the base KGE model. The preprocessing serves two purposes: one is to back-propagate the loss
from the neural weight predictor to all learnable parameters, another is to make the loss from
the scoring function and the loss from the neural weight predictor as consistent as possible in
the adjustment of the parameters in the back-propagation. For TransH, the scoring function is:
 = − ‖(h − w⊤hw ) + dr − (t − w⊤tw )‖2
2
where dr is the relation-specific translation vector and
w is the relation-specific hyperplane.</p>
      <p>Correspondingly, the predicted weight   can be calculated by the weighting prediction
component is:
  =  (</p>
      <p>(h − w⊤hw ) + dr − (t − w⊤tw ))
We call this model TransHExt, i.e., extending TransH based on WeExt.</p>
      <sec id="sec-2-1">
        <title>1.1. Training Protocol</title>
        <p>For a given positive training set
 = {⟨(ℎ ,   ,   ) ,   ⟩}=0 ,

we generate a negative set
 ′ = {(ℎ′,  ,  ′)} = {(ℎ′,   ,   ) ∣ ℎ′ ∈  ⧵ {ℎ  }} ∪ {(ℎ ,   ,  ′) ∣  ′ ∈  ⧵ {  }}=0 .

We measure the accuracy of the neural weight predictor with respect to the error on the weight
prediction in each triple of  :
 (ℎ,  , ,  ) =
{
− |−  |

0,
,   ∈ [0, 2 ]
ℎ  
We adopt margin ranking loss as the loss function for the proposed models:
ℒ =</p>
        <p>∑
⟨(ℎ,, ),⟩∈</p>
        <p>∑
(ℎ′, ′, ′)∈ ′
 +  (ℎ,  , ) +  (ℎ,  , ,  ) − 
(ℎ′,  ′,  ′)
where  is the margin. Since negative triples represent unencoded facts in the real world, it is
not necessary to measure the loss of prediction on this set.</p>
      </sec>
      <sec id="sec-2-2">
        <title>1.2. Evaluation Protocol</title>
        <p>We evaluate the developed TransHExt on link prediction and weight prediction. For link
prediction, given a test triple (ℎ ,   ,   ), ℎ is removed and the head entity is replaced by each of
the entities of the dictionary in turn to form all possible triples. Triple scores are calculated
by the scoring function  =  (ℎ,   ,   ). We sort  by ascending order, and get the rank of the
 -th correct triple in its all possible triples rk . We adopt mean rank (MR= ||
1</p>
        <p>||
∑
=1 rk ), mean
reciprocal rank (MRR= |1|</p>
        <p>||
∑
=1 rk
of the models on link prediction. The [⋅] is the indicator function, which outputs 1 if the input
is true, 0 otherwise. This whole procedure is repeated while removing   instead of ℎ .</p>
        <p>For weight prediction, we predict the weight of a given triple and report the mean squared
error (MSE) and mean absolute error (MAE) between the predicted weight and the real weight.
=1 [ rk ≤  ] to measure the performance</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>2. Experiment and Result</title>
      <p>
        We did experiments on CN15K, and PPI5K [8] datasets. CN15K is a subgraph of ConceptNet [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ],
containing 15,000 entities and 241,158 weighted triples in English. NL27k is extracted from NELL
[9], a weighted KG obtained from webpage reading. NL27k contains 27,221 entities, 404 relations,
and 175,412 weighted triples. PPI5k is a subset of the protein-protein interaction knowledge
base STRING [5] that contains 271,666 weighted triples for 4,999 proteins and 7 interactions.
STRING labels the interactions between proteins with the probabilities of occurrence.
      </p>
      <p>We implemented the neural weight predictor using a 4-layer neural network with 50 inputs,
three hidden layers with 300, 100, 50 neurons, and one output layer, also with ReLU activations.
We set learning rate  for the stochastic gradient descent optimizer to 0.0001. We trained the
models for 3000 epochs, evaluated the models every 100 epochs, and chose the best result
according to MRR. The margin  was set to 1. The dimension of embeddings was set to 50.</p>
      <p>The results of link prediction and weight prediction are shown in Table 1 and Table 2,
respectively. TransHExt outperforms TransH on link prediction in general, but gets a worse
Hits@1 score on CN15K, NL27K and PPI5K. We assume this may be caused by the preprocessing.
We will explore more preprocessing methods for WeExt. For weight prediction, TransHExt
outperforms both of URGE and UKGE on CN15K and PPI5K, but gets a worse performance
than UKGE on NL27K. We hypothesize this is caused by the diferent weight distribution of the
dataset. We will explore more in our future work.</p>
    </sec>
    <sec id="sec-4">
      <title>Acknowledgments</title>
      <p>This work was supported by JST SPRING, Grant Number JPMJSP2102. This work was also
partially supported by JSPS Grant-in-Aid for Early-Career Scientists (Grant Number 22K18004),
JSPS Grant-in-Aid for Scientific Research (Grant Number 21K12042), and the New Energy and
Industrial Technology Development Organization (Grant Number JPNP20006).
[5] D. Szklarczyk, A. Franceschini, S. Wyder, K. Forslund, D. Heller, J. Huerta-Cepas, M.
Simonovic, A. C. J. Roth, A. Santos, K. Tsafou, M. Kuhn, P. Bork, L. J. Jensen, C. von Mering,
String v10: protein–protein interaction networks, integrated over the tree of life, Nucleic
Acids Research 43 (2015) D447 – D452.
[6] Z. Wang, J. Zhang, J. Feng, Z. Chen, Knowledge graph embedding by translating on
hyperplanes, in: AAAI, 2014.
[7] X. Chen, M. Chen, W. Shi, Y. Sun, C. Zaniolo, Embedding uncertain knowledge graphs,</p>
      <p>AAAI (2019).
[8] T. Dettmers, P. Minervini, P. Stenetorp, S. Riedel, Convolutional 2d knowledge graph
embeddings, in: AAAI, 2018.
[9] T. M. Mitchell, W. W. Cohen, E. R. Hruschka, P. P. Talukdar, B. Yang, J. Betteridge, A.
Carlson, B. Dalvi, M. Gardner, B. Kisiel, J. Krishnamurthy, N. Lao, K. Mazaitis, T. Mohamed,
N. Nakashole, E. A. Platanios, A. Ritter, M. Samadi, B. Settles, R. C. Wang, D. Wijaya, A. K.
Gupta, X. Chen, A. Saparov, M. Greaves, J. Welling, Never-ending learning,
Communications of the ACM 61 (2015) 103 – 115.
[10] J. Hu, R. Cheng, Z. Huang, Y. Fang, S. Luo, On embedding uncertain graphs, CIKM (2017).</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>X.</given-names>
            <surname>Hu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Shu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>X.</given-names>
            <surname>Huang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Qu</surname>
          </string-name>
          ,
          <article-title>Edg-based question decomposition for complex question answering over knowledge bases</article-title>
          ,
          <source>in: ISWC</source>
          ,
          <year>2021</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>C.</given-names>
            <surname>Xiong</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Power</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Callan</surname>
          </string-name>
          ,
          <article-title>Explicit semantic ranking for academic search via knowledge graph embedding</article-title>
          ,
          <source>WWW</source>
          (
          <year>2017</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>Z.</given-names>
            <surname>Wang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.</given-names>
            <surname>Chen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J. S. J.</given-names>
            <surname>Ren</surname>
          </string-name>
          ,
          <string-name>
            <given-names>W.</given-names>
            <surname>Yu</surname>
          </string-name>
          , H. Cheng, L. Lin,
          <article-title>Deep reasoning with knowledge graph for social relationship understanding</article-title>
          ,
          <source>in: IJCAI</source>
          ,
          <year>2018</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>R.</given-names>
            <surname>Speer</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Chin</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Havasi</surname>
          </string-name>
          ,
          <article-title>Conceptnet 5.5: An open multilingual graph of general knowledge</article-title>
          ,
          <source>in: AAAI</source>
          ,
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>