chinese-whispers
An implementation of Chinese Whispers in Python.
Science Score: 57.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 5 DOI reference(s) in README -
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (13.2%) to scientific vocabulary
Keywords
Repository
An implementation of Chinese Whispers in Python.
Basic Info
- Host: GitHub
- Owner: nlpub
- License: mit
- Language: Python
- Default Branch: master
- Homepage: https://chinese-whispers.readthedocs.io
- Size: 679 KB
Statistics
- Stars: 60
- Watchers: 5
- Forks: 14
- Open Issues: 0
- Releases: 18
Topics
Metadata Files
README.md
Chinese Whispers for Python
This is an implementation of the Chinese Whispers clustering algorithm in Python. Since this library is based on NetworkX, it is simple to use.
Installation
Usage
Given a NetworkX graph G, this library can cluster it using the following code:
python
from chinese_whispers import chinese_whispers
chinese_whispers(G, weighting='top', iterations=20)
As the result, each node of the input graph is provided with the label attribute that stores the cluster label.
The library also offers a convenient command-line interface (CLI) for clustering graphs represented in the ABC tab-separated format (source\ttarget\tweight).
```shell
Write karate_club.tsv (just as example)
python3 -c 'import networkx as nx; nx.writeweightededgelist(nx.karateclubgraph(), "karate_club.tsv", delimiter="\t")'
Using as CLI
chinese-whispers karate_club.tsv
Using as module (same CLI as above)
python3 -mchinesewhispers karateclub.tsv ```
A more complete usage example is available in the example notebook and at https://nlpub.github.io/chinese-whispers/.
In case you require higher performance, please consider our Java implementation that also includes other graph clustering algorithms: https://github.com/nlpub/watset-java.
Citation
- Ustalov, D., Panchenko, A., Biemann, C., Ponzetto, S.P.: Watset: Local-Global Graph Clustering with Applications in Sense and Frame Induction. Computational Linguistics 45(3), 423–479 (2019)
bibtex
@article{Ustalov:19:cl,
author = {Ustalov, Dmitry and Panchenko, Alexander and Biemann, Chris and Ponzetto, Simone Paolo},
title = {{Watset: Local-Global Graph Clustering with Applications in Sense and Frame Induction}},
journal = {Computational Linguistics},
year = {2019},
volume = {45},
number = {3},
pages = {423--479},
doi = {10.1162/COLI_a_00354},
publisher = {MIT Press},
issn = {0891-2017},
language = {english},
}
Copyright
Copyright (c) 2018–2025 Dmitry Ustalov. See LICENSE for details.
Owner
- Name: NLPub
- Login: nlpub
- Kind: organization
- Location: The Internet
- Website: https://nlpub.ru
- Repositories: 20
- Profile: https://github.com/nlpub
Citation (CITATION.cff)
cff-version: 1.2.0
message: If you use this software, please cite the article from preferred-citation.
authors:
- family-names: Ustalov
given-names: Dmitry
orcid: "https://orcid.org/0000-0002-9979-2188"
title: Chinese Whispers for Python
license: MIT
repository-artifact: https://pypi.org/project/chinese-whispers/
repository-code: https://github.com/nlpub/chinese-whispers
preferred-citation:
type: article
authors:
- family-names: Ustalov
given-names: Dmitry
- family-names: Panchenko
given-names: Alexander
- family-names: Biemann
given-names: Chris
- family-names: Ponzetto
given-names: Simone Paolo
title: "Watset: Local-Global Graph Clustering with Applications in Sense and Frame Induction"
year: 2019
journal: Computational Linguistics
volume: 45
issue: 3
start: 423
end: 479
doi: "10.1162/COLI_a_00354"
issn: 0891-2017
GitHub Events
Total
- Watch event: 2
- Delete event: 6
- Issue comment event: 3
- Push event: 17
- Pull request review event: 2
- Pull request review comment event: 5
- Pull request event: 13
- Fork event: 1
- Create event: 7
Last Year
- Watch event: 2
- Delete event: 6
- Issue comment event: 3
- Push event: 17
- Pull request review event: 2
- Pull request review comment event: 5
- Pull request event: 13
- Fork event: 1
- Create event: 7
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 0
- Total pull requests: 10
- Average time to close issues: N/A
- Average time to close pull requests: 3 days
- Total issue authors: 0
- Total pull request authors: 1
- Average comments per issue: 0
- Average comments per pull request: 0.2
- Merged pull requests: 8
- Bot issues: 0
- Bot pull requests: 10
Past Year
- Issues: 0
- Pull requests: 8
- Average time to close issues: N/A
- Average time to close pull requests: 3 days
- Issue authors: 0
- Pull request authors: 1
- Average comments per issue: 0
- Average comments per pull request: 0.25
- Merged pull requests: 6
- Bot issues: 0
- Bot pull requests: 8
Top Authors
Issue Authors
Pull Request Authors
- dependabot[bot] (10)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 1,615 last-month
- Total docker downloads: 72
- Total dependent packages: 1
- Total dependent repositories: 14
- Total versions: 24
- Total maintainers: 1
pypi.org: chinese-whispers
An implementation of the Chinese Whispers clustering algorithm.
- Homepage: https://github.com/nlpub/chinese-whispers
- Documentation: https://chinese-whispers.readthedocs.io
- License: MIT
-
Latest release: 0.9.0
published over 1 year ago
Rankings
Maintainers (1)
Dependencies
- build * develop
- flake8 * develop
- matplotlib * develop
- mypy * develop
- notebook * develop
- twine * develop
- chinese-whispers *
- actions/checkout v3 composite
- actions/create-release v1.1.4 composite
- actions/setup-python v4 composite
- pypa/gh-action-pypi-publish release/v1 composite
- actions/checkout v3 composite
- actions/setup-python v4 composite
- citation-file-format/cffconvert-github-action 2.0.0 composite
- peaceiris/actions-gh-pages v3.9.1 composite
- networkx >= 2.1,< 4.0