#similarity #ontology #calculations #ontologies #semantic #terms #python

semsimian

Rust 实现的本体语义相似度计算

11 个版本

0.2.18 2024年8月2日
0.2.17 2024年7月23日
0.2.16 2024年5月7日
0.2.15 2024年3月14日
0.2.11 2023年11月29日

#776开发工具

Download history 61/week @ 2024-05-01 52/week @ 2024-05-08 2/week @ 2024-05-15 4/week @ 2024-05-22 9/week @ 2024-07-03 85/week @ 2024-07-10 81/week @ 2024-07-17 63/week @ 2024-07-24 98/week @ 2024-07-31 6/week @ 2024-08-07

每月 275 次下载

BSD-3-ClauseGPL-3.0 许可证

28MB
6.5K SLoC

Rust 5K SLoC // 0.1% comments Jupyter Notebooks 681 SLoC // 0.1% comments Python 530 SLoC // 0.0% comments

semsimian

semsimian 是一个用于快速进行本体语义相似度计算的软件包。它是一个带有 Python 接口的 Rust 库。

这包括实现本体的术语 Jaccard 和 Resnik 相似度,以及计算两个术语集合相似度(所谓的术语集相似度)的方法。未来还将添加其他方法。

semsimian 目前已集成到 OAKMonarch app,以提供快速语义相似度计算。

Rust 安装

  • cargo添加 semsimian

Python 安装

  • 设置您选择的虚拟环境。
  • cd semsimian (此项目的家目录)
  • pip install maturin
  • maturin develop
  • python
Python 3.9.16 (main, Jan 11 2023, 10:02:19) 
[Clang 14.0.6 ] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from semsimian import Semsimian
>>> s = Semsimian([('banana', 'is_a', 'fruit'), ('cherry', 'is_a', 'fruit')])
>>> s.jaccard_similarity('banana', 'cherry')

这应该返回一个值为 1.0。

版本

截至版本 0.2.11,semsimian 源代码发布在 GitHub 上,相应的 Python 轮子发布到 PyPi,并在 crates.io 上有相应的发布。

依赖关系

~37–67MB
~1M SLoC