Git Product home page Git Product logo

semantic-kge's Introduction

SemanticKGE

LibKGE plugin implementing methods aimed at the incorporation of semantic information in knowledge graph embeddings.

Installation

Make sure LibKGE is installed (see the repo for instructions).

Then, using pip:

git clone https://github.com/sfschouten/semantic-kge.git
pip install -e semantic-kge

Once SemKGE and LibKGE are both installed please follow LibKGE's instructions on downloading/preparing the data.

After, one final data preprocessing step is necessary, which adds the type information to the datasets. This can be done with the following snippet of shell commands.

cp -rT '<KGE_HOME>/data/wnrr' '<SEMKGE_HOME>/data/wnrr-typed'
cp -rT '<KGE_HOME>/data/fb15k-237' '<SEMKGE_HOME>/data/fb15k-237-typed'

cd <SEMKGE_HOME>/data
mkdir -p ".tmp"

cd <SEMKGE_HOME>/data/.tmp
!curl -L https://surfdrive.surf.nl/files/index.php/s/N1c8VRH0I6jTJuN/download --output wn18rr.tar.gz
!curl -L https://surfdrive.surf.nl/files/index.php/s/rGqLTDXRFLPJYg7/download --output fb15k-237.tar.gz
tar xzf wn18rr.tar.gz
tar xzf fb15k-237.tar.gz
cp WN18RR/entity2type.txt <SEMKGE_HOME>/data/wnrr-typed/entity_types.txt
cp FB15k-237/entity2type.txt <SEMKGE_HOME>/data/fb15k-237-typed/entity_types.txt
cd ..

python preprocess_types.py wnrr-typed
python preprocess_types.py fb15k-237-typed

Results - Existing Methods

MRR Hits@1 Hits@3 Hits@10 Config file
TransT

Results - Our Methods

MRR Hits@1 Hits@3 Hits@10 Config file

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.