Crates.io | semsimian |
lib.rs | semsimian |
version | 0.2.19 |
source | src |
created_at | 2023-11-29 16:54:55.341687 |
updated_at | 2024-08-26 16:58:57.47691 |
description | Sematic similarity calculations for ontologies implemented in Rust. |
homepage | |
repository | |
max_upload_size | |
id | 1053336 |
size | 29,932,256 |
Semsimian is a package to provide fast semantic similarity calculations for ontologies. It is a Rust library with a Python interface.
This includes implementation of Jaccard and Resnik similarity of terms in an ontology, as well as a method to calculate the similarity of two sets of terms (so-called termset similarity). Other methods will be added in the future.
Semsimian is currently integrated into OAK and the Monarch app to provide fast semantic similarity calculations.
cargo add semsimian
semsimian
(home directory of this project)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')
This should yield a value of 1.0.
As of version 0.2.11, the semsimian source is released on GitHub, with a corresponding set of Python wheels released to PyPi and a corresponding release in crates.io.