<!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>
      <journal-title-group>
        <journal-title>S. Liu); p.g.omran@anu.edu.au (P. G. Omran); kerry.taylor@anu.edu.au (K. Taylor)</journal-title>
      </journal-title-group>
    </journal-meta>
    <article-meta>
      <title-group>
        <article-title>Data Augmented Knowledge Graph Completion via Pre-trained Language Models</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Shixuan Liu</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Pouya Ghiasnezhad Omran</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Kerry Taylor</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Australian National University</institution>
          ,
          <addr-line>ACT 2601, Canberra</addr-line>
          ,
          <country country="AU">Australia</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>China Telecom Corporation Ltd. Data&amp;AI Technology Company</institution>
          ,
          <addr-line>1301, 13 / F, Building 1, No. 31 Financial Street, Xicheng District, Beijing</addr-line>
          ,
          <country country="CN">China</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2023</year>
      </pub-date>
      <volume>000</volume>
      <fpage>0</fpage>
      <lpage>0002</lpage>
      <abstract>
        <p>Knowledge graphs provide significant assistance for many artificial intelligence tasks, but they are usually incomplete. Techniques for knowledge graph completion can improve the coverage of Knowledge Graphs (KGs) by inducing new facts. Traditional methods for completion use structural representations in embedding space, but textual information can also be helpful. Recently, pre-trained language models have shown impressive performance on natural language processing tasks. KG-BERT is a pre-trained language model that is used for knowledge graph completion and achieves appealing performance. However, KG-BERT struggles when the number of facts is inadequate. We consider the inadequacy of data for various relations and the compensation for sparsity via data augmentation. We propose two knowledge graph data augmentation methods to generate facts with novel relations. Specifically, multi-hop relations between two entities are extracted to form multi-hop facts, and implicit relations are generated by horn rules. Moreover, we find multi-hop facts are useful for few-shot learning scenarios. Our system improves the performance of KG-BERT regarding the accuracy of the link prediction task. The experimental results demonstrate that our models make significant enhancements for KG-BERT on several knowledge graph completion benchmarks (e.g., WN18RR and UMLS).</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;Knowledge Graph Completion</kwd>
        <kwd>Pre-trained Language Models</kwd>
        <kwd>Data Augmentation</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>
        Knowledge graphs (KG) are effective structures for machine learning, composed of
’triples’—pairs of entities and a relation. Given KGs’ inherent incompleteness, efforts are
made to complete them by inferring plausible triples. Transformer-based models like BERT
[
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] have excelled in transferring pre-training knowledge to specific tasks. KG-BERT [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] is a
notable development in this field, which employs pre-trained language models for KG Completion
(KGC). It fine-tunes BERT models with concatenated text descriptions of triples and utilizes
contextualized embedding to evaluate the validity of a potential fact.
      </p>
      <p>Although KG-BERT demonstrates great achievement on the link prediction task, it can be
further improved. Due to the incompleteness of knowledge graphs, some potential relationships
could be further explored. For example, there are two triples (Anthony Albanese, born_in_city,
Sydney) and (Sydney, located_in, Australia). According to these two triples, Anthony Albanese
and Australia can use an alternative relation that may not appear in the knowledge graph to
directly represent their relationship, i.e., nationality_of. Besides, the potential relations explored
by rules could also give further information. For example, consider the rule co_work(X, Y) ←
work_at(X, A) ∧ work_at(Y, A), where X, Y, A can be any entity that satisfies this rule and co_work
and work_at are existing relations. Not all entities satisfying the rule’s body will satisfy its head,
it usually has a confidence score to show its reliability. If we want to find a relation that could
describe (X, Y) while it should be semantically similar with co_work, like one relation expressing
work in the same company. This kind of relation is a loose implicit expression of the original
one, and it is worthwhile to investigate how to generate relations like it. While the rule learners
can mine rules with relatively low confidence, we cannot apply all these rules to KG directly and
treat all infrared facts as valid facts to KG.</p>
      <p>In this paper, we improve the Knowledge Graph-BERT (KG-BERT) with two innovative data
augmentation techniques. First, a multi-hop data augmentation approach boosts the overall
performance and offers an effective solution for few-shot learning. Second, the creation of
implicit facts using AnyBURL-generated horn rules. Such facts express implicit information by
constructing similar relations by dropout. These strategies together significantly improve the
robustness and performance of KG-BERT.</p>
    </sec>
    <sec id="sec-2">
      <title>2. Related work</title>
      <p>
        KG-BERT: BERT [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], as a landmark pre-trained language model, has achieved great performance
on multiple NLP tasks. KG-BERT is an application of pre-trained language models on the
knowledge graph completion task [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. KG-BERT makes some changes to the fine-tuning process
to suit the knowledge graph completion task. For a triple (h,r,t)(h, r, t), we could concatenate
the head entity, relation, and tail entity as a sequence of tokens and encode them into word
embeddings which can be represented as Wℎ = (w1ℎ, w2ℎ, ..., wℎℎ ), W = (w1, w2, ..., w )
and W = (w1 , w2 , ..., w ) respectively, where ℎ,  and  are the length of head entity, relation
and tail entity. Eventually, we concatenate sequences by special tokens [CLS] and [SEP] as W̃︁ =
[w[CLS], Wℎ, w[SEP], W, w[SEP], W, w[SEP]]. Meanwhile, different segment ids (0 and 1)
are used to distinguish entity and relation as [w[CLS](0), Wℎ(0), w[SEP](0), W(1), w[SEP](1),
W(0), w[SEP](0)]. The head and tail entities have the same segment embeddings (type 0), which
are different from the segment embeddings of the relation (type 1). The pooling output of [CLS]
in the last hidden state will be seen as the representation of the whole triple and will be fed into a
binary classifier to determine if the triple is real. In prediction, the positive probability of triples
is used for ranking.
      </p>
      <p>
        Rule Learning: Rule-based models, such as AnyBURL [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ], can not only complete the knowledge
graph but can also enable mining the rules, which may themselves be rich in information
[
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. AnyBURL is based on sampling paths and generalizing them to Horn rules. For each
generated ground path rule, its format is like ℎ(0, 1) ← 1(1, 2), ..., (, +1), where
{ℎ, 1, ...} ∈ ℛ and {0, 1, ...} ∈ ℰ . The head of the rule is ℎ(...) while body is 1(...) to
(...). There are two types of generated rules, cyclic (0 = +1) and acyclic (0 ̸= +1). The
quality of early sampling can be improved by reinforcement learning. Meanwhile, the summarized
rules and corresponding confidence scores are applied for knowledge graph completion.
      </p>
    </sec>
    <sec id="sec-3">
      <title>3. Augmentation for Language Model-based KGC</title>
      <p>The flow chart shown in figure 1 shows how original data and two kinds of augmented data
are fed into language models. For an LM-based KGC such as KG-BERT, we directly input
the original knowledge graph  into the model. For data augmentation via multi-hops, the
multi-hop triples are extracted as a knowledge graph  and fed into the model. For data
augmentation via rules, the implicit triples are extracted as a knowledge graph  . Differently
to  and  , it first converts to word embeddings and is implemented dropout and then
fed into the model.</p>
      <p>
        Augmentation via Multi-hop Facts: For entities ℎ and , assume a series of  triples such as
{(ℎ, 1, 1), (1, 2, 2), ..., (− 1, , )}. We can present their relation in a multi-hop format
like ℎ→−1 1→−2 2→−... − 1→− . In order to make multi-hop triples adaptable for pre-trained
language models, we ignore the entities in the relation and get the triple (ℎ, 1 ⊕ 2 ⊕ ... ⊕ , ).
We convert such triples suitable format and call this method Data Augmentation via Multi-Hop
(DAMH). Assume a multi-hop triple has  relations as (ℎ, 1 ⊕ ... ⊕ , ), then the text sequence
W̃︁DAMH can be represented as shown in formula 1. After that, we input W̃︁DAMH into a
pretrained language model and take out the pooled embedding CDAMH as the representation of the
entire multi-hop triple. Besides, constructing 2-hop triples for relations that infrequently appear
in training dataset can effectively improve the performance, which we call this few-shot learning
in knowledge graph completion [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ].
      </p>
      <p>W̃︁DAMH = [w[CLS], Wℎ, w[SEP], W1 , w[SEP], ..., W , w[SEP], W, w[SEP]]
(1)</p>
      <p>Augmentation via Horn Rules: Rule-based models such as AnyBURL can find potential
triples by exploring horn rules. The information implied in these rules can also be used to generate
augmented triples. By exploring implicit patterns in a knowledge graph, the rule-based model
can obtain rules such as co-work(X,Y) ← work_at(X,A) ∧ work_at(Y,A), where co-work(X,Y) is
head and work_at(X,A) ∧ work_at(Y,A) is body. But not all entities X,Y,AX, Y, A satisfying body
can get the head. If we need to find an implicit relation which can describe these entity pairs, then
it should have some similarity to the original relation.</p>
      <p>
        Inspired by SimCSE [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ], there is a simple and effective way to construct implicit relations
by dropout. We directly implement relation embeddings dropout for creating implicit relations,
referred to Data Augmentation via Implicit (DAI). As shown in formula 2 and 3, the dropout
token embeddings added segment and position embeddings forms new token embeddings. We
ifnd even for graphs with only low-confidence rules, this approach can make improvements.
      </p>
      <p>W̃︁ token = [wt[oCkLenS], Wtℎoken, wt[oSkEePn], Dropout(Wtoken, wt[oSkEePn]), Wtoken, wt[oSkEePn]]
(2)
(3)</p>
      <p>W̃︁ DAI = W̃︁ token + W̃︁ segment + W̃︁ position</p>
    </sec>
    <sec id="sec-4">
      <title>4. Experiments and Conclusion</title>
      <p>
        We conduct a set of experiments to assess the performance of our data augmentation methods.
We evaluate our Data Augmentation via Implicit triples method on four datasets, while two of
them are open-source WN18RR [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] and UMLS[
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]. Two of them are reconstructed for few-shot
learning. FB15k-237(few-shot) takes part in the test triples in FB15k-237 [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ], whose relations are
top 50 infrequently appearing in the training dataset. NELL-ONE(few-shot) [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] are reconstructed
as follows, for each set of triples in one relation, we separate in proportion (0.7, 0.1, 0.2) for
training, validation, and test, respectively.
      </p>
      <p>We have released our code and detailed results 1, and generated augmented datasets for training,
favoring 2-hop data extraction for optimal performance. DAMH expands the training datasets of
WN18RR and UMLS by 158% and 307% respectively. Statistics of datasets are also published
in the link. We adopted KG-BERT’s hyper-parameter settings due to high computational costs.
Our methods are compared with other baselines on UMLS and WN18RR datasets. Test samples
involved creating negative samples by replacing the head or tail entity with other entities not
present in the training set.</p>
      <p>From the comparison of experimental results in table 1, it can be seen that KG-BERT+DAMH,
KG-BERT+DAI, and KG-BERT+DAMH+DAI all outperform the original KG-BERT on both
1Detailed experimental results and code can be found at https://github.com/LSX-Sneakerprogrammer/
KG-Augmentation
WN18RR and UMLS datasets. For the Hits@10 metric, the most significant improvement
on WN18RR is from KG-BERT+DAI+DAMH (+10.6% compared with KG-BERT), while for
UMLS is from KG-BERT+DAMH (+0.5% compared with KG-BERT). For the mean rank metric,
KG-BERT+DAMH outperforms the official result of KG-BERT by a significant 12 on WN18RR
and a smaller 0.08 on UMLS. These results establish that our augmentation approaches make
significant progress on these well-studied tasks.</p>
      <p>For few-shot learning, we evaluate models on two datasets, FB15k-237 (few-shot) and
NELLONE (few-shot), and compare them to KG-BERT. We can see the results in table 1 for FB15k-237
(few-shot). The improvements of KG-BERT+DAMH are 7.8% and 3, respectively for Hits@10
and Mean Rank. For the NELL-ONE (few-shot) dataset, the KG-BERT+DAMH surpasses
KG-BERT on four metrics. These experimental results demonstrate the effectiveness of our
method on few-shot learning.</p>
      <p>Our study proposes generating augmented triples via multi-hop connections and horn rules,
effectively enhancing KG-BERT, particularly with the multi-hop method. Both methods and their
combined form remarkably improve performance, with the multi-hop approach notably
strengthening few-shot learning tasks. Future research should investigate integrating the augmented data
with other knowledge graph completion methods.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>L.</given-names>
            <surname>Yao</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Mao</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Luo</surname>
          </string-name>
          ,
          <article-title>Kg-bert: Bert for knowledge graph completion</article-title>
          , arXiv preprint arXiv:
          <year>1909</year>
          .
          <volume>03193</volume>
          (
          <year>2020</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>J.</given-names>
            <surname>Devlin</surname>
          </string-name>
          , M.-
          <string-name>
            <given-names>W.</given-names>
            <surname>Chang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Lee</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Toutanova</surname>
          </string-name>
          , BERT:
          <article-title>Pre-training of deep bidirectional transformers for language understanding</article-title>
          ,
          <source>in: NAACL-HLT</source>
          ,
          <year>2019</year>
          , pp.
          <fpage>4171</fpage>
          -
          <lpage>4186</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>C.</given-names>
            <surname>Meilicke</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M. W.</given-names>
            <surname>Chekol</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Fink</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Stuckenschmidt</surname>
          </string-name>
          ,
          <article-title>Reinforced anytime bottom up rule learning for knowledge graph completion</article-title>
          , arXiv preprint arXiv:
          <year>2004</year>
          .
          <volume>04412</volume>
          (
          <year>2020</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>P. G.</given-names>
            <surname>Omran</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Z.</given-names>
            <surname>Wang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Wang</surname>
          </string-name>
          ,
          <article-title>Knowledge graph rule mining via transfer learning</article-title>
          ,
          <source>in: Advances in Knowledge Discovery and Data Mining: 23rd Pacific-Asia Conference, PAKDD</source>
          <year>2019</year>
          , Macau, China,
          <source>April 14-17</source>
          ,
          <year>2019</year>
          , Proceedings,
          <source>Part III 23</source>
          , Springer,
          <year>2019</year>
          , pp.
          <fpage>489</fpage>
          -
          <lpage>500</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>C.</given-names>
            <surname>Zhang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Yao</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Huang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Jiang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Z.</given-names>
            <surname>Li</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N. V.</given-names>
            <surname>Chawla</surname>
          </string-name>
          ,
          <article-title>Few-shot knowledge graph completion</article-title>
          ,
          <source>in: Proceedings of the AAAI conference on artificial intelligence</source>
          , volume
          <volume>34</volume>
          ,
          <year>2020</year>
          , pp.
          <fpage>3041</fpage>
          -
          <lpage>3048</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>T.</given-names>
            <surname>Gao</surname>
          </string-name>
          ,
          <string-name>
            <given-names>X.</given-names>
            <surname>Yao</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Chen</surname>
          </string-name>
          , Simcse:
          <article-title>Simple contrastive learning of sentence embeddings</article-title>
          ,
          <source>in: EMNLP</source>
          ,
          <year>2021</year>
          , pp.
          <fpage>6894</fpage>
          -
          <lpage>6910</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>T.</given-names>
            <surname>Dettmers</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Minervini</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Stenetorp</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Riedel</surname>
          </string-name>
          ,
          <article-title>Convolutional 2d knowledge graph embeddings</article-title>
          ,
          <source>in: AAAI</source>
          ,
          <year>2018</year>
          , pp.
          <fpage>1811</fpage>
          -
          <lpage>1818</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>K.</given-names>
            <surname>Toutanova</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Chen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Pantel</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Poon</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Choudhury</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Gamon</surname>
          </string-name>
          ,
          <article-title>Representing text for joint embedding of text and knowledge bases</article-title>
          ,
          <source>in: EMNLP</source>
          ,
          <year>2015</year>
          , pp.
          <fpage>1499</fpage>
          -
          <lpage>1509</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>W.</given-names>
            <surname>Xiong</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Yu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Chang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>X.</given-names>
            <surname>Guo</surname>
          </string-name>
          ,
          <string-name>
            <given-names>W. Y.</given-names>
            <surname>Wang</surname>
          </string-name>
          ,
          <article-title>One-shot relational learning for knowledge graphs</article-title>
          ,
          <source>in: EMNLP</source>
          ,
          <year>2018</year>
          , pp.
          <fpage>1980</fpage>
          -
          <lpage>1990</lpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>