# Knowledge Graph Autoencoder Training Environment (KGATE)
KGATE is a knowledge graph embedding library bridging the encoders from [Pytorch Geometric](https://github.com/pyg-team/pytorch_geometric) and the decoders from [TorchKGE](https://github.com/torchkge-team/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.
```python
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](#license) file for details.
Raw data
{
"_id": null,
"home_page": "https://github.com/BAUDOTlab/KGATE",
"name": "KGATE",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "Knowledge Graph, Knowledge Graph Embedding, Autoencoder, Machine Learning, Link Prediction",
"author": "Benjamin Loire",
"author_email": "benjamin.loire@univ-amu.fr",
"download_url": "https://files.pythonhosted.org/packages/db/8f/598b92ee58b8739b6bc92939da29728a674ca4cb7d87b2aa3008dfc68c1f/kgate-0.1.19.tar.gz",
"platform": null,
"description": "# Knowledge Graph Autoencoder Training Environment (KGATE)\n\nKGATE is a knowledge graph embedding library bridging the encoders from [Pytorch Geometric](https://github.com/pyg-team/pytorch_geometric) and the decoders from [TorchKGE](https://github.com/torchkge-team/torchkge).\n\nThis 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.\n\n## Installation\n\nTo join in the development, clone this repository and install Poetry:\n\n```pip install poetry```\n\nInstall the dependencies with:\n\n```poetry install```\n\n## Usage\n\nKGATE 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.\n\n```python\nfrom kgate import Architect\n\nconfig_path = \"/path/to/your/config.toml\"\n\narchitect = Architect(config = config_path)\n\n# Train the model using KG and hyperparameters specified in the configuration\narchitect.train()\n\n# Test the trained model, using the best checkpoint\narchitect.test()\n\n# Run KG completion task, the empty list is the element that will be predicted\nknown_heads = []\nknown_relations = []\nknown_tails = []\narchitect.infer(known_heads, known_relations, known_tails)\n```\n\nFor a more detailed example and specific methods that are available in the package, see the upcoming readthedocs documentation.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](#license) file for details.",
"bugtrack_url": null,
"license": "MIT",
"summary": "Knowledge Graph Autoencoder Training Environment, bridging PyG encoders and TorchKGE decoders.",
"version": "0.1.19",
"project_urls": {
"Homepage": "https://github.com/BAUDOTlab/KGATE",
"Repository": "https://github.com/BAUDOTlab/KGATE",
"issues": "https://github.com/BAUDOTlab/KGATE/issues"
},
"split_keywords": [
"knowledge graph",
" knowledge graph embedding",
" autoencoder",
" machine learning",
" link prediction"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "e2f9a03c4b5684ff225a80a37bedc7671b7592a8ea0696f3b8da590da4c122fa",
"md5": "b5789fe788e32dea9e055cada117c3b9",
"sha256": "12257ace5b69e7fc91ea6bdcb376ad6af19feedce045a516e4dab399be19cf3d"
},
"downloads": -1,
"filename": "kgate-0.1.19-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b5789fe788e32dea9e055cada117c3b9",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 57463,
"upload_time": "2025-05-06T14:43:27",
"upload_time_iso_8601": "2025-05-06T14:43:27.026055Z",
"url": "https://files.pythonhosted.org/packages/e2/f9/a03c4b5684ff225a80a37bedc7671b7592a8ea0696f3b8da590da4c122fa/kgate-0.1.19-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "db8f598b92ee58b8739b6bc92939da29728a674ca4cb7d87b2aa3008dfc68c1f",
"md5": "dcea4cab47f7c62be4c8ea769715d25a",
"sha256": "0e4331d9c966911a083204332f4ed95d3004418e20be5c0bd222bd3c39c4cb39"
},
"downloads": -1,
"filename": "kgate-0.1.19.tar.gz",
"has_sig": false,
"md5_digest": "dcea4cab47f7c62be4c8ea769715d25a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 50171,
"upload_time": "2025-05-06T14:43:28",
"upload_time_iso_8601": "2025-05-06T14:43:28.599963Z",
"url": "https://files.pythonhosted.org/packages/db/8f/598b92ee58b8739b6bc92939da29728a674ca4cb7d87b2aa3008dfc68c1f/kgate-0.1.19.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-05-06 14:43:28",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "BAUDOTlab",
"github_project": "KGATE",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "kgate"
}