基于 OpenKE-PyTorch 开发的知识图谱嵌入工具包
Project description
UniKE — 知识图谱嵌入工具包
基于 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)
- 增加了文档
正确的
- 增加了
R-GCN模型 - 增加了
CompGCN模型 - 修复了 SimplE模型实现的问题
- 修复了 HolE 深度学习框架(pytorch)的版本适配问题
高效的
- 使用
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 Lu,Fengzhen Hou 提供(按时间顺序排列)。
Project details
Release history Release notifications | RSS feed
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.tar.gz
(130.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
unike-3.4.0-py3-none-any.whl
(105.9 kB
view details)
File details
Details for the file unike-3.4.0.tar.gz.
File metadata
- Download URL: unike-3.4.0.tar.gz
- Upload date:
- Size: 130.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
164ba4d652e81011d1eb7a93f64cf096108b8cb209c03e9d0d53171f81ca2858
|
|
| MD5 |
95175cc89b94327d7a009d8ba2a23324
|
|
| BLAKE2b-256 |
838bd43a0b60131de7b85799ca86559aed5a2470f79bb0cf2fbcdd89c47d6f79
|
File details
Details for the file unike-3.4.0-py3-none-any.whl.
File metadata
- Download URL: unike-3.4.0-py3-none-any.whl
- Upload date:
- Size: 105.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5cae04ee965bfdb9e87dc7b5a45ff8c87d52b1bb6255dead3e97fa7fea48d729
|
|
| MD5 |
cd5336413cf2a17c23afc55aab6a7f59
|
|
| BLAKE2b-256 |
a117edeb0853f7fdf3258ca0cdb4235b706fff833ce467797fa63bdef0df3af3
|