Skip to main content

Python implementation of the Coreference-based Graph Search (CGS) algorithm.

Project description

Coreference-based Graph Search (CGS)

PyPI version

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.2.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

pycgs-1.0.2-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file pycgs-1.0.2.tar.gz.

File metadata

  • Download URL: pycgs-1.0.2.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

Hashes for pycgs-1.0.2.tar.gz
Algorithm Hash digest
SHA256 6eeb4325aac2c9361c546149dd7be977556ab22225c5d8404ee8252f7d80e2cb
MD5 e6cc8cc181bd06e2bbece6d4e148fd6b
BLAKE2b-256 f3fee332b1f530558f4983162e874b9bd58c71d2d3b5d52dd22055852d01d12d

See more details on using hashes here.

File details

Details for the file pycgs-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: pycgs-1.0.2-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

Hashes for pycgs-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 fb336541d4c69606a09a9501c1fff86ed1f6e92df822ce2852eed2eb8e33abd4
MD5 ccc10a8b0c2825e83ceb65117f8bf4d2
BLAKE2b-256 e3a9c7e7bd0fe2e6cb2d7aa68fa976eb85052f4f42e17723b339893843c84e8a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page