chinese-whispers

An implementation of Chinese Whispers in Python.

https://github.com/nlpub/chinese-whispers

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

chinese-whispers clustering graph graph-clustering networkx python
Last synced: 6 months ago · JSON representation ·

Repository

An implementation of Chinese Whispers in Python.

Basic Info
Statistics
  • Stars: 60
  • Watchers: 5
  • Forks: 14
  • Open Issues: 0
  • Releases: 18
Topics
chinese-whispers clustering graph graph-clustering networkx python
Created about 8 years ago · Last pushed 6 months ago
Metadata Files
Readme License Citation

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.

Unit Tests Read the Docs PyPI Version Conda Version

Installation

  • pip: pip install chinese-whispers
  • Anaconda: conda install conda-forge::chinese-whispers

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

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

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
dependencies (10) github_actions (10)

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.

  • Versions: 24
  • Dependent Packages: 1
  • Dependent Repositories: 14
  • Downloads: 1,615 Last month
  • Docker Downloads: 72
Rankings
Docker downloads count: 3.1%
Dependent repos count: 3.9%
Dependent packages count: 4.8%
Average: 6.2%
Downloads: 6.3%
Stargazers count: 8.9%
Forks count: 10.2%
Maintainers (1)
Last synced: 6 months ago

Dependencies

Pipfile pypi
  • build * develop
  • flake8 * develop
  • matplotlib * develop
  • mypy * develop
  • notebook * develop
  • twine * develop
  • chinese-whispers *
.github/workflows/release.yml actions
  • actions/checkout v3 composite
  • actions/create-release v1.1.4 composite
  • actions/setup-python v4 composite
  • pypa/gh-action-pypi-publish release/v1 composite
.github/workflows/test.yml actions
  • 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
pyproject.toml pypi
  • networkx >= 2.1,< 4.0
setup.py pypi