AmpliGraph

AccentureApache-2.0活跃维护

用 Python 在知识图谱上做表示学习,把实体和关系训练成向量,方便做链接预测和关系推理。

Python library for Representation Learning on Knowledge Graphs https://docs.ampligraph.org

2.2.0发布于 2026-07-06 11:38 UTC2,244star257fork同步于 2026-11-10 11:44 UTC

怎么上手

由 README 提炼,执行前请确认
pip install ampligraph
硬件要求按 README 说明

README 未给出显存要求;基于 TensorFlow 2,设计为可在 CPU 和 GPU 上运行以加速训练,未列出具体 GPU 厂商或型号。

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

基于 TensorFlow 的知识图谱表示学习库,用来生成嵌入并预测实体间缺失的链接

用 Python 在知识图谱上做表示学习,把实体和关系训练成向量,方便做链接预测和关系推理。

核心能力

  • 提供 TransE、DistMult、ComplEx、HolE、RotatE 等嵌入模型
  • 用模型专属打分函数预测知识图谱中未见的新链接
  • Keras 风格 API,减少训练链接预测模型所需代码量
  • 内置数据集加载、MRR 等评估指标与发现类高层 API
  • 可继承基础 estimator 自行扩展新的嵌入模型

容易踩的坑

需 Python 3.9–3.11;2.0 起改用 TensorFlow 2 后端,数据输入输出管线已变更且部分旧模型不再支持;ConvE、ConvKB 仅在 2.0 之前的版本中提供。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本2.2.0
  1. 2.2.0AmpliGraph 2.2.0最新正式版2026-07-06 · 2026-07-06 11:38 UTC
    • Updated tensorflow dependency up to <2.16
    • Streamlined installation and switched to UV

    Full Changelog: https://github.com/Accenture/AmpliGraph/compare/2.1.0...2.2.0

  2. 2.1.0AmpliGraph 2.1.02024-02-28 · 2024-02-28 15:44 UTC
    查看更新说明

    See detailed release note.

  3. 2.0.1AmpliGraph 2.0.12023-07-12 · 2023-07-12 18:26 UTC
    查看更新说明
  4. 2.0.0AmpliGraph 2.0.02023-03-08 · 2023-03-08 18:54 UTC
    查看更新说明

    See detailed release notes.

  5. 1.4.0AmpliGraph 1.4.02021-05-25 · 2021-05-25 16:57 UTC
    查看更新说明

    See detailed release notes.

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    AmpliGraph

    DOI

    Documentation Status

    CircleCI

    Join the conversation on Slack

    Open source library based on TensorFlow that predicts links between concepts in a knowledge graph.

    AmpliGraph is a suite of neural machine learning models for relational Learning, a branch of machine learning that deals with supervised learning on knowledge graphs.

    Use AmpliGraph if you need to:

    • Discover new knowledge from an existing knowledge graph.
    • Complete large knowledge graphs with missing statements.
    • Generate stand-alone knowledge graph embeddings.
    • Develop and evaluate a new relational model.

    AmpliGraph's machine learning models generate knowledge graph embeddings, vector representations of concepts in a metric space:

    It then combines embeddings with model-specific scoring functions to predict unseen and novel links:

    AmpliGraph 2.0.0 is now available!

    The new version features TensorFlow 2 back-end and Keras style APIs that makes it faster, easier to use and extend the support for multiple features. Further, the data input/output pipeline has changed, and the support for some obsolete models was discontinued. See the Changelog for a more thorough list of changes.

    Key Features

    • 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.
    • 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.
    • Extensible: Roll your own knowledge graph embeddings model by extending AmpliGraph base estimators.

    Modules

    AmpliGraph includes the following submodules:

    • Datasets: helper functions to load datasets (knowledge graphs).
    • Models: knowledge graph embedding models. AmpliGraph 2 contains TransE, DistMult, ComplEx, HolE (More to come!)
    • Evaluation: metrics and evaluation protocols to assess the predictive power of the models.
    • Discovery: High-level convenience APIs for knowledge discovery (discover new facts, cluster entities, predict near duplicates).
    • Compat: submodule that extends the compatibility of AmpliGraph 2 APIs to those of AmpliGraph 1.x for the user already familiar with them.

    Installation

    Prerequisites

    • Linux, macOS, Windows
    • Python 3.9 – 3.11

    Install AmpliGraph

    To install the latest stable release from pip:

    pip install ampligraph
    

    To sanity check the installation, run the following:

    >>> import ampligraph
    >>> ampligraph.__version__
    '2.2.0'
    

    If instead you want the most recent development version, you can clone the repository from GitHub, install AmpliGraph from source and checkout the develop branch. In this way, your local working copy will be on the latest commit on the develop branch.

    git clone https://github.com/Accenture/AmpliGraph.git
    cd AmpliGraph
    git checkout develop
    uv sync
    

    To sanity check the installation, run the following:

    >>> import ampligraph
    >>> ampligraph.__version__
    '2.2-dev'
    

    Predictive Power Evaluation (MRR Filtered)

    AmpliGraph includes implementations of TransE, DistMult, ComplEx, HolE and RotatE. Versions <2.0 also includes ConvE, and ConvKB. Their predictive power is reported below and compared against the state-of-the-art results in literature. More details available here.

    FB15K-237WN18RRYAGO3-10FB15kWN18
    Literature Best0.35*0.48*0.49*0.84**0.95*
    TransE0.310.220.500.620.66
    DistMult0.300.470.480.710.82
    ComplEx0.310.510.490.730.94
    HolE0.300.470.470.730.94
    RotatE0.310.510.430.700.95
    ConvE (AmpliGraph v1.4)0.260.450.300.500.93
    ConvE (1-N, AmpliGraph v1.4)0.320.480.400.800.95
    ConvKB (AmpliGraph v1.4)0.230.390.300.650.80

    Documentation

    Documentation available here

    The project documentation can be built from your local working copy with:

    cd docs
    make clean autogen html
    

    How to contribute

    See guidelines from AmpliGraph documentation.

    How to Cite

    If you like AmpliGraph and you use it in your project, why not starring the project on GitHub!

    GitHub stars

    If you instead use AmpliGraph in an academic publication, cite as:

    @misc{ampligraph,
     author= {Luca Costabello and
              Alberto Bernardi and
              Adrianna Janik and
              Aldan Creo and
              Sumit Pai and
              Chan Le Van and
              Rory McGrath and
              Nicholas McCarthy and
              Pedro Tabacof},
     title = {{AmpliGraph: a Library for Representation Learning on Knowledge Graphs}},
     month = mar,
     year  = 2019,
     doi   = {10.5281/zenodo.2595043},
     url   = {https://doi.org/10.5281/zenodo.2595043}
    }
    

    License

    AmpliGraph is licensed under the Apache 2.0 License.