Skip to main content

Knowledge Graph Autoencoder Training Environment, bridging PyG encoders and TorchKGE decoders.

Project description

Knowledge Graph Autoencoder Training Environment (KGATE)

KGATE is a knowledge graph embedding library bridging the encoders from Pytorch Geometric and the decoders from TorchKGE.

This tool relies heavily on the performances of TorchKGE and its numerous implemented modules for link prediction, negative sampling and model evaluation. The main goal here is to address the lack of encoders in the original library, who is unfortunately not maintained anymore.

Installation

To join in the development, clone this repository and install Poetry:

pip install poetry

Install the dependencies with:

poetry install

Usage

KGATE is meant to be a self-sufficient training environment for knowledge graph embedding that requires very little code to work but can easily be expanded or modified. Everything stems from the Architect class, which holds all the necessary attributes and methods to fully train and test a KGE model following the autoencoder architecture, as well as run inference.

from kgate import Architect

config_path = "/path/to/your/config.toml"

architect = Architect(config = config_path)

# Train the model using KG and hyperparameters specified in the configuration
architect.train()

# Test the trained model, using the best checkpoint
architect.test()

# Run KG completion task, the empty list is the element that will be predicted
known_heads = []
known_relations = []
known_tails = []
architect.infer(known_heads, known_relations, known_tails)

For a more detailed example and specific methods that are available in the package, see the upcoming readthedocs documentation.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kgate-0.1.1.tar.gz (34.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kgate-0.1.1-py3-none-any.whl (39.7 kB view details)

Uploaded Python 3

File details

Details for the file kgate-0.1.1.tar.gz.

File metadata

  • Download URL: kgate-0.1.1.tar.gz
  • Upload date:
  • Size: 34.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.12.7 Windows/10

File hashes

Hashes for kgate-0.1.1.tar.gz
Algorithm Hash digest
SHA256 eedb8f8fda9b3158cd9efd75ef6e57a7a53c5c1821da9d1362137df48908ae86
MD5 2dcb4f292f68730a7f3fbe86ebd8455a
BLAKE2b-256 ed40546a9c9af4f1a353407b10e477b0d0c35fbda9c7fb179c1cb57f17421b1e

See more details on using hashes here.

File details

Details for the file kgate-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: kgate-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 39.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.12.7 Windows/10

File hashes

Hashes for kgate-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 304b6b695a0c0bf7c503d2aab0f3bc72c9de77fa47085fe789ac2347aa9c5f4b
MD5 ead708c2c04671838665a30b15d1e928
BLAKE2b-256 6eca938fb36c320d799b82a0ecab34c47e101f87e17bc716e7296b0769ddea06

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page