<!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>NLP4Types: Predicting Types Using NLP</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Idafen Santana-Perez</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Mariano Rico</string-name>
          <email>mariano.ricog@fi.upm.es</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Ontology Engineering Group, Universidad Politecnica de Madrid</institution>
          ,
          <addr-line>Madrid</addr-line>
          ,
          <country country="ES">Spain</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Type inference for resources in Knowledge Graphs is a widely studied problem, for which di erent approaches have been proposed, including reasoning, statistical analysis, and the usage of the textual information related to the resources. We focus on the latter, exploiting text classi cation techniques for predicting semantic types from textual descriptions. In this paper we introduce NLP4Types, an online tool that combines di erent standard NLP techniques and classi ers for predict types based on DBpedia abstracts, as well as to collect feedback from the users for those predictions.</p>
      </abstract>
      <kwd-group>
        <kwd>DBpedia</kwd>
        <kwd>Natural Language Processing</kwd>
        <kwd>Data Quality</kwd>
        <kwd>Linked Data</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>Type statements, that is, assertions of types for entities, are the most basic and
fundamental piece of information for semantic resources. This information can be
generated by di erent means, including manual, automated and semi-automated
approaches. In this paper we cover DBpedia, which is generated automatically
from the information contained in Wikipedia, using a set of translation
mappings, from the entries in tabular format contained the infoboxes of each page.
As not all pages contain infoboxes it is not always possible to generate type
information. According to our calculation, around a 16% of resources from Wikipedia
do not have any type mapped to DBpedia. We have also to take into account
that, even in those cases in which this information can be generated, it is not
always complete or correct, as mappings are de ned manually and collaboratively
by users.</p>
      <p>In this paper we explore how textual abstracts can be exploited, using NLP
techniques, to classify entries into the DBpedia ontology. We combine
documentto-term matrix and Named Entity Recognition to train a model that we later
use to predict types from free text on our tool. We have evaluated our model
using K-fold evaluation and a well-known gold standard, obtaining high results.
The nal result of this process is NLP4Types1, an online tool that allows user
to explore type predictions and to collect feedback from them.</p>
    </sec>
    <sec id="sec-2">
      <title>Related Work</title>
      <p>
        Typing resources on large datasets is a widely studied problem that has been
addressed during last decade, being SDType [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] the most prominent system.
SDType exploits the statistical information of property distribution to infer new
typing statements. Other approaches have been introduced, exploiting di erent
NLP-based techniques for type assignment based on text [
        <xref ref-type="bibr" rid="ref2 ref3">3, 2</xref>
        ]. In [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] a
hierarchy of Support Vector Machines (hSVM) is introduced for applying
lexicosyntactic patterns using a bag-of-words model, extracted from short abstracts
and Wikipedia categories. This work extends the Linked Hypernym Dataset
Framework [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], by the same authors, for extracting these pattern-based
structures. These works introduce also the LHD Gold Standard dataset, which we use
in this paper, to measure the performance of our system and compare it to other
existing tools. This gold standard has been produced, as reported by authors,
using experts to assign types to a subset of the English DBpedia resources. We
have used it to evaluate our system, as it provides means for comparing our
contribution to both, hSVM and SDType.
3
      </p>
    </sec>
    <sec id="sec-3">
      <title>Text Classi cation</title>
      <p>
        We have implemented a pipeline in which di erent NLP techniques are combined,
for a total of seven steps. These are the main features of these steps: A) Get
Abstract text: get the text from available abstracts. All those resources that
do not have an abstract are discarded as they can not be used to train our
system. B) Named Entity Recognition: using DBpedia Spotlight [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] the
system detects the Named Entities (NE) on the text, obtaining their types.
The surface form of those entities is simply ignored and only the types (e.g.
Person, Organization) are used, adding them as new words to the text. C) Text
pre-process: apply several text normalization techniques on the abstracts (i.e.
stop words, lemmatization, and stemming). D) Data Vectorization: translate
textual data into a vector space model, using a Bag of Words approach. We apply
a TF-IDF metric to get a more discriminatory score. E) Training: train the
classi er, using the vectorized data generated before. We have used a Support
Vector Machine classi er, as they has been proven to be e cient, performing
at the state-of-the-art level2. F) Prediction: predict types either from test
data, reserved during the training phase, or from new unseen data. We use these
training and prediction steps when validating our approach against the gold
standard. G) Evaluation: evaluating the results obtained, comparing how
the predictions t the labelled data. To reduce over tting, we apply a 5-fold
evaluation and the aforementioned gold standard.
      </p>
      <sec id="sec-3-1">
        <title>2https://nlp.stanford.edu/IR-book/html/htmledition/</title>
        <p>support-vector-machines-and-machine-learning-on-documents-1.html</p>
        <p>
          The system has been implemented in Python, including NLTK [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ] and
scikitlearn [
          <xref ref-type="bibr" rid="ref8">8</xref>
          ] libraries for NLP and machine learning processing. The code is available
online.3
4
        </p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>Evaluation</title>
      <p>
        We have selected four main metrics for evaluating our results. In a general
classi cation problem, if the predicted label is not the same as the expected one, the
prediction is computed as an error. However, when working with labels
structured in a hierarchy, more exible evaluation metrics can be de ned to take this
into account. This is discussed in [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ], where authors use the hierarchical
precision, recall, and F-measure to evaluate the performance of di erent systems over
the same gold standard used in our evaluation. Thus, we use these metrics, plus
the regular accuracy, to evaluate our system.
      </p>
      <p>We have executed our evaluation using the English version of the DBpedia
dataset, from the 2016-10 release, which contains a total of 3.048.742 resources
with both type and abstract. Resources that are typed only with owl:Thing are
not considered, as inferring this type is trivial and does not add any information
for the classi cation problem. We have executed a 5-fold evaluation over the
DBpedia resources, to obtain performance results. We have also evaluated it
using the aforementioned gold standard, using only the resources with an abstract
associated. From the total of 2.092 resources, 1.825 meet this requirement.</p>
      <p>The results obtained are depicted in Table 1. As we can see, the more data we
are able to use for training the system, the more precise it gets, obtaining around
a 95% of hierarchical F-measure when using the full training set. By using the
gold standard dataset, we can compare our system to hSVM and SDType4. As
we can see, in general, our system outperforms both hSVM and SDType over
the gold standard resources.</p>
      <sec id="sec-4-1">
        <title>3https://github.com/idafensp/NLP4Types</title>
        <p>
          4We have included only the highest results reported, shown in Table 6 of the cited
paper by Kliegr et. al. [
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]
which is used to predict types. Currently only types belonging to the DBpedia
ontology are predicted.
        </p>
        <p>Once a prediction is obtained, the user can evaluate the result and provide
feedback. As shown in Figure 1, ve di erent criteria are provided, to specify
whether the prediction is wrong or right, or how it should be improved. Once
the user selects one, it is asked for some extra feedback, including the expected
type, user expertise and text source. The main goal of this tool is to collect this
feedback and allow to analyze and improve the system and its evaluation</p>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>J.</given-names>
            <surname>Daiber</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Jakob</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Hokamp</surname>
          </string-name>
          , and
          <string-name>
            <given-names>P. N.</given-names>
            <surname>Mendes</surname>
          </string-name>
          .
          <article-title>Improving e ciency and accuracy in multilingual entity extraction</article-title>
          .
          <source>In I-Semantics</source>
          <year>2013</year>
          ,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <given-names>S.</given-names>
            <surname>Faralli</surname>
          </string-name>
          and
          <string-name>
            <given-names>S. P.</given-names>
            <surname>Ponzetto</surname>
          </string-name>
          .
          <article-title>A hearst-like pattern-based approach to hypernym extraction and class induction</article-title>
          .
          <source>In Semantic Web Evaluation Challenge</source>
          ,
          <year>2016</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <given-names>A.</given-names>
            <surname>Gangemi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A. G.</given-names>
            <surname>Nuzzolese</surname>
          </string-name>
          , et al.
          <article-title>Automatic Typing of DBpedia Entities</article-title>
          . In
          <source>International Semantic Web Conference Proc., pages</source>
          <volume>65</volume>
          {
          <fpage>81</fpage>
          ,
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <given-names>T.</given-names>
            <surname>Kliegr</surname>
          </string-name>
          .
          <article-title>Linked hypernyms: Enriching dbpedia with targeted hypernym discovery</article-title>
          .
          <source>Journal of Web Semantics</source>
          ,
          <volume>31</volume>
          :
          <fpage>59</fpage>
          {
          <fpage>69</fpage>
          ,
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <given-names>T.</given-names>
            <surname>Kliegr</surname>
          </string-name>
          and
          <string-name>
            <given-names>O.</given-names>
            <surname>Zamazal</surname>
          </string-name>
          .
          <source>LHD 2</source>
          .
          <article-title>0: A text mining approach to typing entities in knowledge graphs</article-title>
          .
          <source>Journal of Web Semantics</source>
          ,
          <volume>39</volume>
          :
          <fpage>47</fpage>
          {
          <fpage>61</fpage>
          ,
          <year>2016</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <given-names>E.</given-names>
            <surname>Loper</surname>
          </string-name>
          and
          <string-name>
            <given-names>S.</given-names>
            <surname>Bird</surname>
          </string-name>
          .
          <article-title>Nltk: The natural language toolkit</article-title>
          .
          <source>ETMTNLP '02</source>
          , pages
          <fpage>63</fpage>
          {
          <fpage>70</fpage>
          ,
          <string-name>
            <surname>Stroudsburg</surname>
          </string-name>
          , PA, USA,
          <year>2002</year>
          .
          <article-title>Association for Computational Linguistics</article-title>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <given-names>H.</given-names>
            <surname>Paulheim</surname>
          </string-name>
          and
          <string-name>
            <given-names>C.</given-names>
            <surname>Bizer</surname>
          </string-name>
          .
          <article-title>Type Inference on Noisy RDF Data</article-title>
          .
          <source>In The Semantic Web { ISWC</source>
          <year>2013</year>
          , pages
          <fpage>510</fpage>
          {
          <fpage>525</fpage>
          ,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <given-names>F.</given-names>
            <surname>Pedregosa</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G.</given-names>
            <surname>Varoquaux</surname>
          </string-name>
          , et al.
          <article-title>Scikit-learn: Machine learning in Python</article-title>
          .
          <source>Journal of Machine Learning Research</source>
          ,
          <volume>12</volume>
          :
          <fpage>2825</fpage>
          {
          <fpage>2830</fpage>
          ,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>