{"id":13564476,"url":"https://github.com/Accenture/AmpliGraph","last_synced_at":"2025-04-03T21:30:54.710Z","repository":{"id":39838502,"uuid":"164881995","full_name":"Accenture/AmpliGraph","owner":"Accenture","description":"Python library for Representation Learning on Knowledge Graphs https://docs.ampligraph.org","archived":false,"fork":false,"pushed_at":"2024-11-22T16:48:16.000Z","size":44317,"stargazers_count":2200,"open_issues_count":29,"forks_count":251,"subscribers_count":65,"default_branch":"develop","last_synced_at":"2025-03-27T19:01:25.457Z","etag":null,"topics":["graph-embeddings","graph-representation-learning","knowledge-graph","knowledge-graph-embeddings","machine-learning","relational-learning","representation-learning"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Accenture.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-09T14:52:05.000Z","updated_at":"2025-03-27T14:00:02.000Z","dependencies_parsed_at":"2024-06-18T21:35:00.781Z","dependency_job_id":"41670a7f-fa76-4758-8d81-3faf32724499","html_url":"https://github.com/Accenture/AmpliGraph","commit_stats":{"total_commits":1257,"total_committers":20,"mean_commits":62.85,"dds":0.786793953858393,"last_synced_commit":"71716acaf30d6dba054a37a74d945ddbcb65beb6"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Accenture%2FAmpliGraph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Accenture%2FAmpliGraph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Accenture%2FAmpliGraph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Accenture%2FAmpliGraph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Accenture","download_url":"https://codeload.github.com/Accenture/AmpliGraph/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247061879,"owners_count":20877176,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["graph-embeddings","graph-representation-learning","knowledge-graph","knowledge-graph-embeddings","machine-learning","relational-learning","representation-learning"],"created_at":"2024-08-01T13:01:31.968Z","updated_at":"2025-04-03T21:30:54.693Z","avatar_url":"https://github.com/Accenture.png","language":"Python","readme":"# ![AmpliGraph](docs/img/ampligraph_logo_transparent_300.png)\n\n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.2595043.svg)](https://doi.org/10.5281/zenodo.2595043)\n\n[![Documentation Status](https://readthedocs.org/projects/ampligraph/badge/?version=latest)](http://ampligraph.readthedocs.io/?badge=latest)\n\n[![CircleCI](https://dl.circleci.com/status-badge/img/gh/Accenture/AmpliGraph/tree/main.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/Accenture/AmpliGraph/tree/main)\n\n\n[Join the conversation on Slack](https://join.slack.com/t/ampligraph/shared_invite/enQtNTc2NTI0MzUxMTM5LTRkODk0MjI2OWRlZjdjYmExY2Q3M2M3NGY0MGYyMmI4NWYyMWVhYTRjZDhkZjA1YTEyMzBkMGE4N2RmNTRiZDg)\n![](docs/img/slack_logo.png)\n\n**Open source library based on TensorFlow that predicts links between concepts in a knowledge graph.**\n\n**AmpliGraph** is a suite of neural machine learning models for relational Learning, a branch of machine learning\nthat deals with supervised learning on knowledge graphs.\n\n\n**Use AmpliGraph if you need to**:\n\n* Discover new knowledge from an existing knowledge graph.\n* Complete large knowledge graphs with missing statements.\n* Generate stand-alone knowledge graph embeddings.\n* Develop and evaluate a new relational model.\n\n\nAmpliGraph's machine learning models generate **knowledge graph embeddings**, vector representations of concepts in a metric space:\n\n![](docs/img/kg_lp_step1.png)\n\nIt then combines embeddings with model-specific scoring functions to predict unseen and novel links:\n\n![](docs/img/kg_lp_step2.png)\n\n\n## AmpliGraph 2.0.0 is now available!\nThe new version features TensorFlow 2 back-end and Keras style APIs that makes it faster, easier to use and \nextend the support for multiple features. Further, the data input/output pipeline has changed, and the support for \nsome obsolete models was discontinued.\u003cbr /\u003e See the Changelog for a more thorough list of changes.\n\n\n## Key Features\n\n* **Intuitive APIs**: AmpliGraph APIs are designed to reduce the code amount required to learn models that predict links in knowledge graphs. The new version AmpliGraph 2 APIs are in Keras style, making the user experience even smoother.\n* **GPU-Ready**: AmpliGraph 2 is based on TensorFlow 2, and it is designed to run seamlessly on CPU and GPU devices - to speed-up training.\n* **Extensible**: Roll your own knowledge graph embeddings model by extending AmpliGraph base estimators.\n\n## Modules\n\nAmpliGraph includes the following submodules:\n\n* **Datasets**: helper functions to load datasets (knowledge graphs).\n* **Models**: knowledge graph embedding models. AmpliGraph 2 contains **TransE**, **DistMult**, **ComplEx**, **HolE** (More to come!)\n* **Evaluation**: metrics and evaluation protocols to assess the predictive power of the models.\n* **Discovery**: High-level convenience APIs for knowledge discovery (discover new facts, cluster entities, predict near duplicates).\n* **Compat**: submodule that extends the compatibility of AmpliGraph 2 APIs to those of AmpliGraph 1.x for the user already familiar with them.\n\n## Installation\n\n### Prerequisites\n\n* Linux, macOS, Windows\n* Python ≥ 3.8\n\n### Provision a Virtual Environment\n\nTo provision a virtual environment for installing AmpliGraph, any option can work; here we will give provide the\ninstruction for using `venv` and `Conda`.\n\n#### venv\n\nThe first step is to create and activate the virtual environment.\n\n```\npython3.8 -m venv PATH/TO/NEW/VIRTUAL_ENVIRONMENT\nsource PATH/TO/NEW/VIRTUAL_ENVIRONMENT/bin/activate\n```\n\nOnce this is done, we can proceed with the installation of TensorFlow 2:\n\n```\npip install \"tensorflow==2.9.0\"\n```\n\nIf you are installing Tensorflow on MacOS, instead of the following please use:\n\n```\npip install \"tensorflow-macos==2.9.0\"\n```\n\n**IMPORTANT**: the installation of TensorFlow can be tricky on Mac OS with the Apple silicon chip. Though `venv` can\nprovide a smooth experience, we invite you to refer to the [dedicated section](#install-tensorflow-2-for-mac-os-m1-chip)\ndown below and consider using `conda` if some issues persist in alignment with the\n[Tensorflow Plugin page on Apple developer site](https://developer.apple.com/metal/tensorflow-plugin/).\n\n\n#### Conda\n\nThe first step is to create and activate the virtual environment.\n\n```\nconda create --name ampligraph python=3.8\nsource activate ampligraph\n```\n\nOnce this is done, we can proceed with the installation of TensorFlow 2, which can be done through `pip` or `conda`.\n\n```\npip install \"tensorflow==2.9.0\"\n\nor \n\nconda install \"tensorflow==2.9.0\"\n```\n\n#### Install TensorFlow 2 for Mac OS M1 chip\n\nWhen installing TensorFlow 2 for Mac OS with Apple silicon chip we recommend to use a conda environment. \n\n```\nconda create --name ampligraph python=3.8\nsource activate ampligraph\n```\n\nAfter having created and activated the virtual environment, run the following to install Tensorflow. \n\n```\nconda install -c apple tensorflow-deps\npip install --user tensorflow-macos==2.9.0\npip install --user tensorflow-metal==0.6\n```\n\nIn case of problems with the installation or for further details, refer to\n[Tensorflow Plugin page](https://developer.apple.com/metal/tensorflow-plugin/) on the official Apple developer website.\n\n### Install AmpliGraph\n\nOnce the installation of Tensorflow is complete, we can proceed with the installation of AmpliGraph.\n\nTo install the latest stable release from pip:\n\n```\npip install ampligraph\n```\n\nTo sanity check the installation, run the following:\n\n```python\n\u003e\u003e\u003e import ampligraph\n\u003e\u003e\u003e ampligraph.__version__\n'2.1.0'\n```\n\nIf instead you want the most recent development version, you can clone the repository from\n[GitHub](https://github.com/Accenture/AmpliGraph.git), install AmpliGraph from source and checkout the `develop`\nbranch. In this way, your local working copy will be on the latest commit on the `develop` branch.\n\n```\ngit clone https://github.com/Accenture/AmpliGraph.git\ncd AmpliGraph\ngit checkout develop\npip install -e .\n```\nNotice that the code snippet above installs the library in editable mode (`-e`).\n\nTo sanity check the installation run the following:\n\n```python\n\u003e\u003e\u003e import ampligraph\n\u003e\u003e\u003e ampligraph.__version__\n'2.1-dev'\n```\n\n\n\n## Predictive Power Evaluation (MRR Filtered)\n\nAmpliGraph includes implementations of TransE, DistMult, ComplEx, HolE and RotatE. Versions \u003c2.0 also includes ConvE,\nand ConvKB.\nTheir predictive power is reported below and compared against the state-of-the-art results in literature.\n[More details available here](https://docs.ampligraph.org/en/latest/experiments.html).\n\n|                              | FB15K-237 | WN18RR    | YAGO3-10 | FB15k      | WN18      |\n|------------------------------|-----------|-----------|----------|------------|-----------|\n| Literature Best              | **0.35*** | 0.48*     | 0.49*    | **0.84**** | **0.95*** |\n| TransE                       | 0.31      | 0.22      | **0.50** | 0.62       | 0.66      |\n| DistMult                     | 0.30      | 0.47      | 0.48     | 0.71       | 0.82      |\n| ComplEx                      | 0.31      | **0.51**  | 0.49     | 0.73       | 0.94      |\n| HolE                         | 0.30      | 0.47      | 0.47     | 0.73       | 0.94      |\n| RotatE                       | 0.31      | **0.51**  | 0.43     | 0.70       | **0.95**  |\n| ConvE (AmpliGraph v1.4)      | 0.26      | 0.45      | 0.30     | 0.50       | 0.93      |\n| ConvE (1-N, AmpliGraph v1.4) | 0.32      | 0.48      | 0.40     | 0.80       | **0.95**  |\n| ConvKB (AmpliGraph v1.4)     | 0.23      | 0.39      | 0.30     | 0.65       | 0.80      |\n\n\u003csub\u003e\n* Timothee Lacroix, Nicolas Usunier, and Guillaume Obozinski. Canonical tensor decomposition for knowledge base \ncompletion. In International Conference on Machine Learning, 2869–2878. 2018. \u003cbr/\u003e\n**  Kadlec, Rudolf, Ondrej Bajgar, and Jan Kleindienst. \"Knowledge base completion: Baselines strike back.\n \" arXiv preprint arXiv:1705.10744 (2017).\n\u003c/sub\u003e\n\n\u003csub\u003e\nResults above are computed assigning the worst rank to a positive in case of ties. \nAlthough this is the most conservative approach, some published literature may adopt an evaluation protocol that assigns\n the best rank instead. \n\u003c/sub\u003e\n\n\n## Documentation\n\n**[Documentation available here](http://docs.ampligraph.org)**\n\nThe project documentation can be built from your local working copy with:\n\n```\ncd docs\nmake clean autogen html\n```\n\n## How to contribute\n\nSee [guidelines](http://docs.ampligraph.org) from AmpliGraph documentation.\n\n\n## How to Cite\n\nIf you like AmpliGraph and you use it in your project, why not starring the project on GitHub!\n\n[![GitHub stars](https://img.shields.io/github/stars/Accenture/AmpliGraph.svg?style=social\u0026label=Star\u0026maxAge=3600)](https://GitHub.com/Accenture/AmpliGraph/stargazers/)\n\n\nIf you instead use AmpliGraph in an academic publication, cite as:\n\n```\n@misc{ampligraph,\n author= {Luca Costabello and\n          Alberto Bernardi and\n          Adrianna Janik and\n          Aldan Creo and\n          Sumit Pai and\n          Chan Le Van and\n          Rory McGrath and\n          Nicholas McCarthy and\n          Pedro Tabacof},\n title = {{AmpliGraph: a Library for Representation Learning on Knowledge Graphs}},\n month = mar,\n year  = 2019,\n doi   = {10.5281/zenodo.2595043},\n url   = {https://doi.org/10.5281/zenodo.2595043}\n}\n```\n\n## License\n\nAmpliGraph is licensed under the Apache 2.0 License.\n","funding_links":[],"categories":["Python","图数据处理","Uncategorized","Transformer-based Model \u003cspan id=\"transformer-based-models-\"\u003e\u003c/span\u003e","machine-learning","Programming","Libraries, Softwares and Tools"],"sub_categories":["Uncategorized","RNN-agnostic Models \u003cspan id=\"rnn-agnostic-models-\"\u003e\u003c/span\u003e","Python","KRL Libraries"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAccenture%2FAmpliGraph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAccenture%2FAmpliGraph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAccenture%2FAmpliGraph/lists"}