Python implementation of the Coreference-based Graph Search (CGS) algorithm.
Project description
Coreference-based Graph Search (CGS)
This is the Python implementation of the CGS algorithm.
Documentation
The documentation for pycgs
is available on the documentation website of the ShennongAlpha (ShennongDoc):
You can also contribute to the documentation on the ShennongDoc
GitHub repository by submitting a pull request:
Foundational CGS
from pycgs import cgs
relationships = [('A', 'B'), ('B', 'C'), ('D', 'B'), ('E', 'F')]
primary_terms = cgs.foundational_cgs(relationships)
print(primary_terms)
# Output:
# {'A': 'C', 'B': 'C', 'C': 'C', 'D': 'C', 'E': 'F', 'F': 'F'}
Weighted CGS
from pycgs import cgs
weighted_relationships = [('A', 'B', 1), ('B', 'C', 2), ('D', 'B', 1), ('B', 'E', 1)]
primary_terms = cgs.weighted_cgs(weighted_relationships)
print(primary_terms)
# Output:
# {'A': 'C', 'B': 'C', 'C': 'C', 'D': 'C', 'E': 'E'}
Cite this work
@misc{yang2024shennongalpha,
title={ShennongAlpha: an AI-driven sharing and collaboration platform for intelligent curation, acquisition, and translation of natural medicinal material knowledge},
author={Zijie Yang and Yongjing Yin and Chaojun Kong and Tiange Chi and Wufan Tao and Yue Zhang and Tian Xu},
year={2024},
eprint={2401.00020},
archivePrefix={arXiv},
primaryClass={cs.AI}
}
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pycgs-1.0.1.tar.gz
(6.6 kB
view details)
Built Distribution
pycgs-1.0.1-py3-none-any.whl
(7.2 kB
view details)
File details
Details for the file pycgs-1.0.1.tar.gz
.
File metadata
- Download URL: pycgs-1.0.1.tar.gz
- Upload date:
- Size: 6.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.11.5 Darwin/23.4.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4524bd8310381ede33653cc8f3135304fbfe245dbaee413a4ab8f0a749648c2 |
|
MD5 | 30407b9454a15847dea58843edd7113b |
|
BLAKE2b-256 | ba3962a22027d77a3c9d84ac25172990cd143490cae51217a63eab65112b1268 |
File details
Details for the file pycgs-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: pycgs-1.0.1-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.11.5 Darwin/23.4.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 03a95e36adfbbbb0e23feb254a8deb837b4965f156e810e884354a48954005fb |
|
MD5 | 6f8a08fd150799354c0e8cbdafa7a16a |
|
BLAKE2b-256 | 3e9510991642935a0a5f22aaa190b35da7bbe328272bd2a86cfec163541f44af |