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.8.tar.gz (35.1 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.8-py3-none-any.whl (40.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: kgate-0.1.8.tar.gz
  • Upload date:
  • Size: 35.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.13.2 Linux/6.10.7-arch1-1

File hashes

Hashes for kgate-0.1.8.tar.gz
Algorithm Hash digest
SHA256 2d145b8dd6bf405b795171a484f61aa0813be69299fa8c3d6eb432d30b6026a2
MD5 9b2b127d372f4e459b30483cc9631d52
BLAKE2b-256 97c181576e39e271f43aaef1c3f6cc28bc047aec2c0ed8e77849bd5a8a3098e5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: kgate-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 40.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.13.2 Linux/6.10.7-arch1-1

File hashes

Hashes for kgate-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 35fde7bda9da1e959f0046908c23ca92914f324774322e6d854458eba63a6545
MD5 23f2406834b5ba615c2940188ca0cf09
BLAKE2b-256 9aafc2f55d1b66678e796ba58d29ac30f7aaed7242c745795ec932ba4140b949

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