{"id":29268385,"url":"https://github.com/cpu-ds/unike","last_synced_at":"2025-07-04T19:13:07.477Z","repository":{"id":301362465,"uuid":"805690920","full_name":"CPU-DS/UniKE","owner":"CPU-DS","description":"基于 OpenKE-PyTorch 开发的知识图谱嵌入工具包，支持跨平台运行，具备自动超参数搜索、高效并行训练以及实验结果记录功能，为研究与应用提供强大助力。","archived":false,"fork":false,"pushed_at":"2025-07-04T05:51:49.000Z","size":296078,"stargazers_count":1,"open_issues_count":0,"forks_count":3,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-04T06:32:35.866Z","etag":null,"topics":["knowledge-graph","knowledge-graph-completion","knowledge-graph-embeddings","link-prediction","python","torch"],"latest_commit_sha":null,"homepage":"https://unike.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CPU-DS.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-05-25T07:29:24.000Z","updated_at":"2025-07-04T05:51:52.000Z","dependencies_parsed_at":"2025-06-26T13:53:50.428Z","dependency_job_id":null,"html_url":"https://github.com/CPU-DS/UniKE","commit_stats":null,"previous_names":["cpu-ds/unike"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/CPU-DS/UniKE","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CPU-DS%2FUniKE","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CPU-DS%2FUniKE/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CPU-DS%2FUniKE/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CPU-DS%2FUniKE/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CPU-DS","download_url":"https://codeload.github.com/CPU-DS/UniKE/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CPU-DS%2FUniKE/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263604171,"owners_count":23487228,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["knowledge-graph","knowledge-graph-completion","knowledge-graph-embeddings","link-prediction","python","torch"],"created_at":"2025-07-04T19:13:05.400Z","updated_at":"2025-07-04T19:13:07.470Z","avatar_url":"https://github.com/CPU-DS.png","language":"Python","readme":"# UniKE — 知识图谱嵌入工具包\n\n[![Documentation Status](https://readthedocs.org/projects/unike/badge/?version=latest)](https://unike.readthedocs.io/zh_CN/latest/?badge=latest)\n\n基于 [OpenKE-PyTorch](https://github.com/thunlp/OpenKE/tree/OpenKE-PyTorch) 开发的知识图谱嵌入工具包，支持跨平台运行，具备自动超参数搜索、高效并行训练以及实验结果记录功能，为研究与应用提供强大助力。\n\n教程和 API 参考文档可以访问 [unike.readthedocs.io](https://unike.readthedocs.io/zh_CN/latest/)。\n\n## 项目结构\n\n- 📁 [`unike/`](https://github.com/CPU-DS/UniKE/tree/main/unike/)  \n  UniKE 源代码保存在 `unike/`\n- 📚 [`docs/`](https://github.com/CPU-DS/UniKE/tree/main/docs/)  \n  所有的文档源文件保存在 `docs/`，所有的 `*.rst` 构成了文档中的各个部分\n- 🌰 [`examples/`](https://github.com/CPU-DS/UniKE/tree/main/examples/)  \n  UniKE 的例子保存在 `examples/`，修改自 `OpenKE-PyTorch`\n- 📍 [`docs/_static/logs/`](https://github.com/CPU-DS/UniKE/tree/main/docs/_static/logs/)  \n  UniKE 的例子运行日志保存在 `docs/_static/logs/`\n- 💡 [`benchmarks/`](https://github.com/CPU-DS/UniKE/tree/main/benchmarks/)  \n  常用的知识图谱保存在 `benchmarks/`\n- 📜 [`README.rst`](https://github.com/CPU-DS/UniKE/tree/main/README.rst)  \n  项目主页\n\n### ⁉️ Questions / comments\n如果你有任何问题，可以在 [Github issue](https://github.com/CPU-DS/UniKE/issues) 提问。\n\n## 快速开始\n\n使用 `pip`\n```bash\npip install unike\n```\n\n## 新特性\n\n### **易用的**\n\n- **1.0.0 版本**: 利用 C++ 重写底层数据处理、C++11 的线程库实现并行、[pybind11](https://github.com/pybind/pybind11) 实现 Python 和 C++ 的交互，进而能够做到跨平台 (Windows, Linux)\n- **2.0.0 版本**: 使用 Python 重写底层数据处理，进而能够做到跨平台 (Windows, Linux)\n- 增加了文档\n\n### **正确的**\n\n- 增加了 `R-GCN`模型\n- 增加了 `CompGCN`模型\n- 修复了 [SimplE模型实现的问题](https://github.com/thunlp/OpenKE/issues/151)\n- 修复了 [HolE](#details_hole) 深度学习框架（pytorch）的版本适配问题\n\n### **高效的**\n\n- 使用 `torch.nn.parallel.DistributedDataParallel` 完成数据并行（**2.0.0 版本** 使用 [accelerate](https://github.com/huggingface/accelerate) 实现），使得 `UniKE` 能够利用多个 `GPU` 同时训练\n- 增加超参数扫描功能（随机搜索、网格搜索和贝叶斯搜索）\n\n### **扩展的**\n\n- 在模型训练过程中，能够在验证集上评估模型（模型能够一次评估多个三元组（batch），能够大大加速模型评估）\n- 增加了学习率调度器\n- 能够利用 [wandb](https://wandb.ai/) 输出日志\n- 实现了早停止\n- 能够自定义 Hits@N\n\n## 支持的知识图谱嵌入模型\n\n| 类型 | 模型 |\n| --- | --- |\n| 平移模型 | `TransE`, `TransH`, `TransR`, `TransD`, `RotatE` |\n| 语义匹配模型 | `RESCAL`, `DistMult`, `HolE`, `ComplEx`, `Analogy`, `SimplE`, `ANALOGY` |\n| 图神经网络模型 | `R-GCN`, `CompGCN` |\n\n## 如何引用这个项目？\n\n如果您发现 UniKE 对您的研究有用，请考虑使用以下 BibTeX 模板引用 UniKE：\n\n```bibtex\n@misc{UniKE,\n   author = {Lu, Yanfeng and Hou, Fengzhen},\n   year = {2024},\n   note = {https://github.com/CPU-DS/UniKE},\n   title = {UniKE: An Open Source Library for Knowledge Graph Embeddings}\n}\n```\n\n该仓库主要由 [Yanfeng Lu](https://github.com/LuYF-Lemon-love)，[Fengzhen Hou](https://github.com/houfz-cpu) 提供（按时间顺序排列）。","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcpu-ds%2Funike","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcpu-ds%2Funike","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcpu-ds%2Funike/lists"}