Skip to main content

scikit-learn Pipelines Meet Knowledge Graphs

The Python kgextension Package

  • Conference paper
  • First Online:
The Semantic Web: ESWC 2021 Satellite Events (ESWC 2021)

Abstract

Python is currently the most used platform for data science and machine learning. At the same time, public knowledge graphs have been identified as a valuable source of background knowledge in many data science tasks. In this paper, we introduce the kgextension package for Python, which allows for using knowledge graph in data science pipelines built in Python. The demo shows how data from public knowledge graphs such as DBpedia and Wikidata can be used in data mining pipelines based on the popular Python package scikit-learn. We demonstrate the package’s utility by showing that the prediction accuracy on a popular Kaggle task can be significantly increased by using background knowledge from DBpedia.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Similar content being viewed by others

Notes

  1. 1.

    https://www.kdnuggets.com/2019/05/poll-top-data-science-machine-learning-platforms.html.

  2. 2.

    https://github.com/RDFLib/rdflib.

  3. 3.

    https://scikit-learn.org/.

  4. 4.

    https://github.com/om-hb/kgextension.

  5. 5.

    Such as http://dbpedia.org/resource/*ENTITY*.

  6. 6.

    https://lookup.dbpedia.org/.

  7. 7.

    https://scikit-learn.org/stable/modules/feature_selection.html.

  8. 8.

    https://github.com/om-hb/kgextension/blob/master/examples/book_genre_prediction.ipynb.

  9. 9.

    https://www.kaggle.com/sootersaalu/amazon-top-50-bestselling-books-2009-2019.

References

  1. Cochez, M., Ristoski, P., Ponzetto, S.P., Paulheim, H.: Global RDF vector space embeddings. In: d’Amato, C., et al. (eds.) ISWC 2017. LNCS, vol. 10587, pp. 190–207. Springer, Cham (2017). https://doi.org/10.1007/978-3-319-68288-4_12

    Chapter  Google Scholar 

  2. Jiménez-Ruiz, E., et al. (ed.): Semantic Web Challenge on Tabular Data to Knowledge Graph Matching (2020)

    Google Scholar 

  3. Fernández, J.D., et al.: Binary RDF representation for publication and exchange (HDT). Web Semantics 19, 22–41 (2013)

    Google Scholar 

  4. Heist, N., Hertling, S., Ringler, D., Paulheim, H.: Knowledge graphs on the web-an overview (2020)

    Google Scholar 

  5. Jeong, Y., Myaeng, S.H.: Feature selection using a semantic hierarchy for event recognition and type classification. In: IJCNLP, pp. 136–144 (2013)

    Google Scholar 

  6. Lu, S., et al.: Domain ontology-based feature reduction for high dimensional drug data and its application to 30-day heart failure readmission prediction. In: COLLABORATECOM, pp. 478–484 (2013)

    Google Scholar 

  7. Paulheim, H., Fürnkranz, J.: Unsupervised generation of data mining features from linked open data. In: WIMS, pp. 1–12 (2012)

    Google Scholar 

  8. Pellegrino, M.A., Cochez, M., Garofalo, M., Ristoski, P.: A configurable evaluation framework for node embedding techniques. In: Hitzler, P., et al. (eds.) ESWC 2019. LNCS, vol. 11762, pp. 156–160. Springer, Cham (2019). https://doi.org/10.1007/978-3-030-32327-1_31

    Chapter  Google Scholar 

  9. Portisch, J., Hladik, M., Paulheim, H.: KGvec2go-knowledge graph embeddings as a service. In: LREC, pp. 5641–5647 (2020)

    Google Scholar 

  10. Ristoski, P., Bizer, C., Paulheim, H.: Mining the web of linked data with RapidMiner. J. Web Semant. 35, 142–151 (2015)

    Article  Google Scholar 

  11. Ristoski, P., Paulheim, H.: A comparison of propositionalization strategies for creating features from linked open data. Linked Data Knowl. Discov. 6 (2014)

    Google Scholar 

  12. Ristoski, P., Paulheim, H.: Feature selection in hierarchical feature spaces. In: Discovery Science, pp. 288–300 (2014)

    Google Scholar 

  13. Ristoski, P., Paulheim, H.: RDF2Vec: RDF graph embeddings for data mining. In: Groth, P., et al. (eds.) ISWC 2016. LNCS, vol. 9981, pp. 498–514. Springer, Cham (2016). https://doi.org/10.1007/978-3-319-46523-4_30

    Chapter  Google Scholar 

  14. Ristoski, P., Paulheim, H.: Semantic web in data mining and knowledge discovery: a comprehensive survey. Web Semant. 36, 1–22 (2016)

    Article  Google Scholar 

  15. Ristoski, P., Rosati, J., Di Noia, T., De Leone, R., Paulheim, H.: RDF2Vec: RDF graph embeddings and their applications. Semantic Web 10(4), 721–752 (2019)

    Article  Google Scholar 

  16. Vandewiele, G., et al.: pyRDF2Vec: Python Implementation and Extension of RDF2Vec. IDLab (2020). https://github.com/IBCNServices/pyRDF2Vec

  17. Verborgh, R., et al.: Triple Pattern Fragments: a low-cost knowledge graph interface for the Web. Web Semantics 37–38, 184–206 (2016)

    Google Scholar 

  18. Voit, M., Paulheim, H.: Bias in knowledge graphs - an empirical study with movie recommendation and different language editions of DBpedia. In: LDK (2021)

    Google Scholar 

  19. Wang, B.B., et al.: A comparative study for domain ontology guided feature extraction. In: ACSC, pp. 69–78 (2003)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Heiko Paulheim .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2021 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Bucher, TC., Jiang, X., Meyer, O., Waitz, S., Hertling, S., Paulheim, H. (2021). scikit-learn Pipelines Meet Knowledge Graphs. In: Verborgh, R., et al. The Semantic Web: ESWC 2021 Satellite Events. ESWC 2021. Lecture Notes in Computer Science(), vol 12739. Springer, Cham. https://doi.org/10.1007/978-3-030-80418-3_2

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-80418-3_2

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-80417-6

  • Online ISBN: 978-3-030-80418-3

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics