{"id":32981490,"url":"https://github.com/nlpub/chinese-whispers","last_synced_at":"2026-01-17T16:31:33.685Z","repository":{"id":28047535,"uuid":"116008581","full_name":"nlpub/chinese-whispers","owner":"nlpub","description":"An implementation of Chinese Whispers in Python.","archived":false,"fork":false,"pushed_at":"2026-01-04T23:24:44.000Z","size":723,"stargazers_count":61,"open_issues_count":0,"forks_count":14,"subscribers_count":5,"default_branch":"master","last_synced_at":"2026-01-13T12:42:23.565Z","etag":null,"topics":["chinese-whispers","clustering","graph","graph-clustering","networkx","python"],"latest_commit_sha":null,"homepage":"https://chinese-whispers.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nlpub.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2018-01-02T11:32:37.000Z","updated_at":"2026-01-04T23:24:48.000Z","dependencies_parsed_at":"2023-12-21T20:10:59.472Z","dependency_job_id":"23b4f2a4-fda7-4d30-9134-59fb5b0dfc5f","html_url":"https://github.com/nlpub/chinese-whispers","commit_stats":null,"previous_names":["nlpub/chinese-whispers"],"tags_count":25,"template":false,"template_full_name":null,"purl":"pkg:github/nlpub/chinese-whispers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nlpub%2Fchinese-whispers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nlpub%2Fchinese-whispers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nlpub%2Fchinese-whispers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nlpub%2Fchinese-whispers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nlpub","download_url":"https://codeload.github.com/nlpub/chinese-whispers/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nlpub%2Fchinese-whispers/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28511867,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T13:38:16.342Z","status":"ssl_error","status_checked_at":"2026-01-17T13:37:44.060Z","response_time":85,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chinese-whispers","clustering","graph","graph-clustering","networkx","python"],"created_at":"2025-11-13T07:00:25.455Z","updated_at":"2026-01-17T16:31:33.668Z","avatar_url":"https://github.com/nlpub.png","language":"Python","funding_links":[],"categories":["Label Propagation, Percolation and Random Walks"],"sub_categories":[],"readme":"# Chinese Whispers for Python\n\nThis is an implementation of the [Chinese Whispers](https://doi.org/10.3115/1654758.1654774) clustering algorithm in Python. Since this library is based on [NetworkX](https://networkx.github.io/), it is simple to use.\n\n[![Unit Tests][github_tests_badge]][github_tests_link] [![Read the Docs][rtfd_badge]][rtfd_link] [![PyPI Version][pypi_badge]][pypi_link] [![Conda Version][conda_badge]][conda_link]\n\n[github_tests_badge]: https://github.com/nlpub/chinese-whispers/actions/workflows/test.yml/badge.svg?branch=master\n[github_tests_link]: https://github.com/nlpub/chinese-whispers/actions/workflows/test.yml\n[rtfd_badge]: https://readthedocs.org/projects/chinese-whispers/badge/\n[rtfd_link]: https://chinese-whispers.readthedocs.io/\n[pypi_badge]: https://badge.fury.io/py/chinese-whispers.svg\n[pypi_link]: https://pypi.python.org/pypi/chinese-whispers\n[conda_badge]: https://anaconda.org/conda-forge/chinese-whispers/badges/version.svg\n[conda_link]: https://anaconda.org/conda-forge/chinese-whispers\n\n## Installation\n\n- [pip](https://pip.pypa.io/): `pip install chinese-whispers`\n- [Anaconda](https://docs.conda.io/en/latest/): `conda install conda-forge::chinese-whispers`\n\n## Usage\n\nGiven a NetworkX graph `G`, this library can [cluster](https://en.wikipedia.org/wiki/Cluster_analysis) it using the following code:\n\n```python\nfrom chinese_whispers import chinese_whispers\nchinese_whispers(G, weighting='top', iterations=20)\n```\n\nAs the result, each node of the input graph is provided with the `label` attribute that stores the cluster label.\n\nThe library also offers a convenient command-line interface (CLI) for clustering graphs represented in the ABC tab-separated format (source`\\t`target`\\t`weight).\n\n```shell\n# Write karate_club.tsv (just as example)\npython3 -c 'import networkx as nx; nx.write_weighted_edgelist(nx.karate_club_graph(), \"karate_club.tsv\", delimiter=\"\\t\")'\n\n# Using as CLI\nchinese-whispers karate_club.tsv\n\n# Using as module (same CLI as above)\npython3 -mchinese_whispers karate_club.tsv\n```\n\nA more complete usage example is available in the [example notebook](https://github.com/nlpub/chinese-whispers/blob/master/docs/tutorial.ipynb).\n\nIn case you require higher performance, please consider our Java implementation that also includes other graph clustering algorithms: \u003chttps://github.com/nlpub/watset-java\u003e.\n\n## Citation\n\n* [Ustalov, D.](https://github.com/dustalov), [Panchenko, A.](https://github.com/alexanderpanchenko), [Biemann, C.](https://www.inf.uni-hamburg.de/en/inst/ab/lt/people/chris-biemann.html), [Ponzetto, S.P.](https://www.uni-mannheim.de/dws/people/professors/prof-dr-simone-paolo-ponzetto/): [Watset: Local-Global Graph Clustering with Applications in Sense and Frame Induction](https://doi.org/10.1162/COLI_a_00354). Computational Linguistics 45(3), 423\u0026ndash;479 (2019)\n\n```bibtex\n@article{Ustalov:19:cl,\n  author    = {Ustalov, Dmitry and Panchenko, Alexander and Biemann, Chris and Ponzetto, Simone Paolo},\n  title     = {{Watset: Local-Global Graph Clustering with Applications in Sense and Frame Induction}},\n  journal   = {Computational Linguistics},\n  year      = {2019},\n  volume    = {45},\n  number    = {3},\n  pages     = {423--479},\n  doi       = {10.1162/COLI_a_00354},\n  publisher = {MIT Press},\n  issn      = {0891-2017},\n  language  = {english},\n}\n```\n\n## Copyright\n\nCopyright (c) 2018\u0026ndash;2026 [Dmitry Ustalov](https://github.com/dustalov). See [LICENSE](LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnlpub%2Fchinese-whispers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnlpub%2Fchinese-whispers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnlpub%2Fchinese-whispers/lists"}