Skip to main content

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

Project description

UniKE — 知识图谱嵌入工具包

Documentation Status GitHub last commit

基于 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.4.0.dev0.tar.gz (130.9 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.4.0.dev0-py3-none-any.whl (106.1 kB view details)

Uploaded Python 3

File details

Details for the file unike-3.4.0.dev0.tar.gz.

File metadata

  • Download URL: unike-3.4.0.dev0.tar.gz
  • Upload date:
  • Size: 130.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for unike-3.4.0.dev0.tar.gz
Algorithm Hash digest
SHA256 32bde660f46ab3b71852fcb223f4de5605aabc69ee692764abd1911240331f14
MD5 ecc753a6b8486108bb89aec14d93e1c3
BLAKE2b-256 c4ca8b987e21964ed82c1a8ac9854c8afb6dc9dda289d67c9c7ce88f3cbebfe3

See more details on using hashes here.

File details

Details for the file unike-3.4.0.dev0-py3-none-any.whl.

File metadata

  • Download URL: unike-3.4.0.dev0-py3-none-any.whl
  • Upload date:
  • Size: 106.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for unike-3.4.0.dev0-py3-none-any.whl
Algorithm Hash digest
SHA256 1de660c1140aab16f926ec9b20646f819a009d69188fc0ed7f021288a0d9e0bb
MD5 10eeccca5511901e810c0930e0a7bc64
BLAKE2b-256 39fd8bc923478e0f2c111fb57cda0f0091445c0acf3532fad1aa272c94a0de1d

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