Skip to main content

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'}

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

Uploaded Source

Built Distribution

pycgs-1.0.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pycgs-1.0.0.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.11.5 Darwin/23.1.0

File hashes

Hashes for pycgs-1.0.0.tar.gz
Algorithm Hash digest
SHA256 a98b8e4745be82a7058f423086fe19a08a4799d36fe2309b3eaae2d4946de021
MD5 ee655d656b0ce8ebf223ba59154f8875
BLAKE2b-256 ec2fcdc4035233f7e91549135476f410fe3f45ef74619ed5a5c154cc756b0f50

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pycgs-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.11.5 Darwin/23.1.0

File hashes

Hashes for pycgs-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eece334d8e3557da481614f0484b7f08417fb54cbf03db740e58744c48397ab1
MD5 2321f89f224103ad72b476bab042a97f
BLAKE2b-256 6567fe79971e6928fc30534d133c2581f7796dfabf34255409ec74ba9dd5fcd9

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