Skip to content

Knowledge Graph Enrichment with Symbolic LEarning

License

Notifications You must be signed in to change notification settings

SDM-TIB/SPARKLE

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

License: MIT

SPaRKLE: Symbolic caPtuRing of knowledge for Knowledge graph enrichment with LEarning

SPaRKLE is a hybrid method that combines symbolic and mathematical methodologies while leveraging Partial Completness Assumption (PCA) heuristics to capture implicit information and enrich Knowledge Graphs (KGs). The combination of symbolic and numerical strategies offers a comprehensive approach to KG enrichment that capitalizes on the strengths of both paradigms. This technique has the potential to provide more extensive, accurate, interpretable, and flexible knowledge representations, thereby improving the usefulness and efficacy of KGs across several domains.

SPaRKLE Design Pattern

Building SPaRKLE from Source

Clone the repository

git clone git@github.com:SDM-TIB/SPARKLE.git

Running SPaRKLE

Installing the dependencies for SPaRKLE create a virtual environment and install the dependencies in the virtual environment created for SPaRKLE. To install the required dependencies run the following command:

pip install -r requirements.txt

Running Symbolic Learning (AMIE) for baseline and SPaRKLE approach inside AMIE_SPaRKLE folder

Executing scripts to reproduce AMIE results by choosing Baseline or SPaRKLE folders and navigating to appropriate path.

Provide configuration for executing

{
  "Type": "Baseline",
  "KG": "FrenchRoyalty",
  "prefix": "http://FrenchRoyalty.org/",
  "rules_file": "french_training.csv",
  "rdf_file": "french_training.nt"
}

The user must supply a few options in the above JSON file to select the type of approach that has to be executed with added configuration details.
The parameter Type corresponds to the type of execution, i.e., Baseline or SPaRKLE.
Secondly, parameter KG is the type of knowledge graph, i.e., FrenchRoyalty or Family or YAGO3-10.
Nextly,prefixparameter is used for preprocessing the predictions results for readability.
Lastly, rules_file and rdf_file are the file names for premined rules and KG in the form of NTfile.

python sparkle_amie.py 

Plots demonstrating SPaRKLE Effectiveness using Linear Regression analysis

French Royalty Family KG YAGO3-10

Running Numerical Learning for baseline and SPaRKLE approach inside KGE folder

Executing scripts to reproduce KGE results by choosing Baseline or SPaRKLE folders and navigating to appropriate path.

Provide configuration for executing

{
  "Type": "Baseline",
  "KG": "frenchRoyalty.tsv",
  "model": ["TransE", "TransH","TransD","ComplEx","ConvE","RotatE","RESCAL"],
  "path_to_results": "./Results/FrenchRoyalty/"
}

The user must provide a few options in the above JSON file to select the type of approach that has to be executed with added configuration details.
The parameter Type corresponds to the type of execution, i.e., Baseline or SPaRKLE.
Secondly, parameter KG is the type of knowledge graph, i.e., FrenchRoyalty or Family or YAGO3-10.
Nextly,modelparameter is used for training the KGE model to generate results for readability.
Lastly, path_to_results is parameter given by user to store the trained model results.

python kge_sparkle.py 

Note: KGE models are trained in Python 3.9 and executed in a virtual machine on Google Colab with 16 GiB VRAM and 1 GPU NVIDIA Tesla 𝑇 4, with CUDA Version 12.0 (Driver 525.105.17) and PyTorch (v2.0.1).

Releases

No releases published

Packages

No packages published

Languages