https://github.com/cpu-ds/unike

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

https://github.com/cpu-ds/unike

Science Score: 36.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    2 of 15 committers (13.3%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (6.8%) to scientific vocabulary

Keywords

knowledge-graph knowledge-graph-completion knowledge-graph-embeddings link-prediction python torch

Keywords from Contributors

archival projection interactive profiles generic sequences observability autograding hacking shellcodes
Last synced: 5 months ago · JSON representation

Repository

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

Basic Info
Statistics
  • Stars: 3
  • Watchers: 0
  • Forks: 3
  • Open Issues: 0
  • Releases: 0
Topics
knowledge-graph knowledge-graph-completion knowledge-graph-embeddings link-prediction python torch
Created over 1 year ago · Last pushed 6 months ago
Metadata Files
Readme License

README.md

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 bash 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:

bibtex @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 提供(按时间顺序排列)。

Owner

  • Name: CPU-DS
  • Login: CPU-DS
  • Kind: organization

GitHub Events

Total
  • Watch event: 1
  • Delete event: 2
  • Push event: 25
  • Fork event: 1
  • Create event: 1
Last Year
  • Watch event: 1
  • Delete event: 2
  • Push event: 25
  • Fork event: 1
  • Create event: 1

Committers

Last synced: 8 months ago

All Time
  • Total Commits: 1,393
  • Total Committers: 15
  • Avg Commits per committer: 92.867
  • Development Distribution Score (DDS): 0.083
Past Year
  • Commits: 10
  • Committers: 1
  • Avg Commits per committer: 10.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
LuYF-Lemon-love 3****9@q****m 1,277
Shulin Cao 2****0@m****n 39
THUCSTHanxu13THUCSTHanxu13THUCSTHanxu13 t****3@g****m 31
wangtao w****u@g****m 10
Joker-Song s****6@1****m 9
韩旭 c****3@1****m 8
Yuchen Lin i@y****z 6
Jae Hee Lee d****i@g****m 3
chenweize1998 c****8@g****m 3
Erick Guan f****s@g****m 2
Pushpankar Kumar Pushp p****k@g****m 1
dependabot[bot] 4****] 1
leo 1****9@q****m 1
cpuds21 c****1@1****m 1
Jun Gao s****o@p****n 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 8 months ago

All Time
  • Total issues: 0
  • Total pull requests: 1
  • Average time to close issues: N/A
  • Average time to close pull requests: less than a minute
  • Total issue authors: 0
  • Total pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
  • LuYF-Lemon-love (1)
  • yanfeng98 (1)
Top Labels
Issue Labels
Pull Request Labels

Dependencies

docs/requirements.txt pypi
  • pillow *
  • sphinx ==7.1.2
  • sphinx-autopackagesummary ==1.3
  • sphinx-copybutton *
  • sphinx-gallery ==0.13.0
  • sphinx-prompt *
  • sphinxcontrib-bibtex *
  • sphinxcontrib-katex *
  • trojanzoo_sphinx_theme *
  • typing-extensions *
pyproject.toml pypi
  • accelerate >=0.20.3
  • numpy >=1.21.6
  • packaging >=24.0
  • pandas >=1.1.5
  • torch >=1.13.1
  • tqdm >=4.67.1
  • wandb >=0.18.7
uv.lock pypi
  • accelerate 1.8.1
  • annotated-types 0.7.0
  • certifi 2025.6.15
  • charset-normalizer 3.4.2
  • click 8.2.1
  • colorama 0.4.6
  • filelock 3.18.0
  • fsspec 2025.5.1
  • gitdb 4.0.12
  • gitpython 3.1.44
  • hf-xet 1.1.5
  • huggingface-hub 0.33.1
  • idna 3.10
  • jinja2 3.1.6
  • markupsafe 3.0.2
  • mpmath 1.3.0
  • networkx 3.5
  • numpy 2.3.1
  • nvidia-cublas-cu12 12.6.4.1
  • nvidia-cuda-cupti-cu12 12.6.80
  • nvidia-cuda-nvrtc-cu12 12.6.77
  • nvidia-cuda-runtime-cu12 12.6.77
  • nvidia-cudnn-cu12 9.5.1.17
  • nvidia-cufft-cu12 11.3.0.4
  • nvidia-cufile-cu12 1.11.1.6
  • nvidia-curand-cu12 10.3.7.77
  • nvidia-cusolver-cu12 11.7.1.2
  • nvidia-cusparse-cu12 12.5.4.2
  • nvidia-cusparselt-cu12 0.6.3
  • nvidia-nccl-cu12 2.26.2
  • nvidia-nvjitlink-cu12 12.6.85
  • nvidia-nvtx-cu12 12.6.77
  • packaging 25.0
  • pandas 2.3.0
  • platformdirs 4.3.8
  • protobuf 6.31.1
  • psutil 7.0.0
  • pydantic 2.11.7
  • pydantic-core 2.33.2
  • python-dateutil 2.9.0.post0
  • pytz 2025.2
  • pyyaml 6.0.2
  • requests 2.32.4
  • safetensors 0.5.3
  • sentry-sdk 2.31.0
  • setproctitle 1.3.6
  • setuptools 80.9.0
  • six 1.17.0
  • smmap 5.0.2
  • sympy 1.14.0
  • torch 2.7.1
  • tqdm 4.67.1
  • triton 3.3.1
  • typing-extensions 4.14.0
  • typing-inspection 0.4.1
  • tzdata 2025.2
  • unike 3.0.1
  • urllib3 2.5.0
  • wandb 0.20.1
.github/workflows/publish-to-pypi.yml actions
  • actions/checkout v4 composite
  • astral-sh/setup-uv v3 composite