Skip to main content

基于 OpenKE-PyTorch 开发的知识图谱嵌入工具包

Project description

UniKE — 知识图谱嵌入工具包

Documentation Status

基于 OpenKE-PyTorch 开发的知识图谱嵌入工具包,支持跨平台运行,具备自动超参数搜索、高效并行训练以及实验结果记录功能,为研究与应用提供强大助力。

教程和 API 参考文档可以访问 unike.readthedocs.io

项目结构

  • 📁 unike/
    UniKE 源代码保存在 unike/
  • 📚 docs/
    所有的文档源文件保存在 docs/,所有的 *.rst 构成了文档中的各个部分
  • 🌰 examples/
    UniKE 的例子保存在 examples/,修改自 OpenKE-PyTorch
  • 📍 docs/_static/logs/
    UniKE 的例子运行日志保存在 docs/_static/logs/
  • 💡 benchmarks/
    常用的知识图谱保存在 benchmarks/
  • 📜 README.rst
    项目主页

⁉️ Questions / comments

如果你有任何问题,可以在 Github issue 提问。

快速开始

使用 pip

pip install unike

新特性

易用的

  • 1.0.0 版本: 利用 C++ 重写底层数据处理、C++11 的线程库实现并行、pybind11 实现 Python 和 C++ 的交互,进而能够做到跨平台 (Windows, Linux)
  • 2.0.0 版本: 使用 Python 重写底层数据处理,进而能够做到跨平台 (Windows, Linux)
  • 增加了文档

正确的

高效的

  • 使用 torch.nn.parallel.DistributedDataParallel 完成数据并行(2.0.0 版本 使用 accelerate 实现),使得 UniKE 能够利用多个 GPU 同时训练
  • 增加超参数扫描功能(随机搜索、网格搜索和贝叶斯搜索)

扩展的

  • 在模型训练过程中,能够在验证集上评估模型(模型能够一次评估多个三元组(batch),能够大大加速模型评估)
  • 增加了学习率调度器
  • 能够利用 wandb 输出日志
  • 实现了早停止
  • 能够自定义 Hits@N

支持的知识图谱嵌入模型

类型 模型
平移模型 TransE, TransH, TransR, TransD, RotatE
语义匹配模型 RESCAL, DistMult, HolE, ComplEx, Analogy, SimplE, ANALOGY
图神经网络模型 R-GCN, CompGCN

如何引用这个项目?

如果您发现 UniKE 对您的研究有用,请考虑使用以下 BibTeX 模板引用 UniKE:

@misc{UniKE,
   author = {Lu, Yanfeng and Hou, Fengzhen},
   year = {2024},
   note = {https://github.com/CPU-DS/UniKE},
   title = {UniKE: An Open Source Library for Knowledge Graph Embeddings}
}

该仓库主要由 Yanfeng LuFengzhen Hou 提供(按时间顺序排列)。

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

unike-3.2.12.tar.gz (110.4 kB view details)

Uploaded Source

Built Distribution

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

unike-3.2.12-py3-none-any.whl (103.0 kB view details)

Uploaded Python 3

File details

Details for the file unike-3.2.12.tar.gz.

File metadata

  • Download URL: unike-3.2.12.tar.gz
  • Upload date:
  • Size: 110.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.16

File hashes

Hashes for unike-3.2.12.tar.gz
Algorithm Hash digest
SHA256 0718d3d9f0f8378eb2e97b9b3c3b8997ed14c35d37e036695df6f8a0aa08d73c
MD5 091ecf2f865bd8234f0c7bea6c0e6f2b
BLAKE2b-256 ae179cefc378ecaed85bce23091eb8b43bfa3a9e90a92ebb293156e119edda50

See more details on using hashes here.

File details

Details for the file unike-3.2.12-py3-none-any.whl.

File metadata

  • Download URL: unike-3.2.12-py3-none-any.whl
  • Upload date:
  • Size: 103.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.16

File hashes

Hashes for unike-3.2.12-py3-none-any.whl
Algorithm Hash digest
SHA256 1cc346027270f86f89d15fce67bab72da5313e877c8bfe38952d644880e607f1
MD5 44ced3ec85fdfa5b48eb96322c942e00
BLAKE2b-256 4f3fc839f703120b8fd82d2bad294c1b554507b03028e7d2d180683107b5535f

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