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.2.17.tar.gz (128.1 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.17-py3-none-any.whl (103.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for unike-3.2.17.tar.gz
Algorithm Hash digest
SHA256 64ef7bcdca176e63bc3b29b115c050d771463e05e01dba0f0f5fbcb0ee440758
MD5 3257be2832f2a1eecce8c294e1256366
BLAKE2b-256 77752419e830812e9331304cb61ac083c0d488f6d5efd0a87cb6860b659eb7be

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for unike-3.2.17-py3-none-any.whl
Algorithm Hash digest
SHA256 d797beaa6d9f134c07e547a01a3795174203d419271a60b6b41d04f953292478
MD5 a59f39c902afbe271140b3cd91accb7b
BLAKE2b-256 8f7590da0789e5e7c01584e193a0b4cae6bc022c8eb2eb9289bf7d67ee813ef0

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