chinese-whispers 0.9.0
pip install chinese-whispers
Released:
An implementation of the Chinese Whispers clustering algorithm.
Navigation
Unverified details
These details have not been verified by PyPIProject links
Meta
- License: MIT License (MIT)
- Author: Dmitry Ustalov
- Tags graph clustering, unsupervised learning, chinese whispers, cluster analysis
- Requires: Python ~=3.8
-
Provides-Extra:
dev
,docs
Classifiers
- Development Status
- Intended Audience
- License
- Operating System
- Programming Language
- Topic
- Typing
Project description
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:
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\t
target\t
weight).
# Write karate_club.tsv (just as example)
python3 -c 'import networkx as nx; nx.write_weighted_edgelist(nx.karate_club_graph(), "karate_club.tsv", delimiter="\t")'
# Using as CLI
chinese-whispers karate_club.tsv
# Using as module (same CLI as above)
python3 -mchinese_whispers karate_club.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)
@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–2024 Dmitry Ustalov. See LICENSE for details.
Project details
Unverified details
These details have not been verified by PyPIProject links
Meta
- License: MIT License (MIT)
- Author: Dmitry Ustalov
- Tags graph clustering, unsupervised learning, chinese whispers, cluster analysis
- Requires: Python ~=3.8
-
Provides-Extra:
dev
,docs
Classifiers
- Development Status
- Intended Audience
- License
- Operating System
- Programming Language
- Topic
- Typing
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file chinese_whispers-0.9.0.tar.gz
.
File metadata
- Download URL: chinese_whispers-0.9.0.tar.gz
- Upload date:
- Size: 10.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed63521dec01210c6f0c3e8a6e234aa2dfd6b1fac47872b1ef285bd1b1723704 |
|
MD5 | 0b71eaf5f09a6efa82c86c0163648a74 |
|
BLAKE2b-256 | 45d3b8d1d6623e6e5042d2b8ed0eb7e4721eacf7d02c195c9680e88601637a2e |
File details
Details for the file chinese_whispers-0.9.0-py3-none-any.whl
.
File metadata
- Download URL: chinese_whispers-0.9.0-py3-none-any.whl
- Upload date:
- Size: 9.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | da5a4842f991229e4799d7bfa117d3bb320732a08361e1a41b5c29254a80212f |
|
MD5 | 5b262fdf70fdebcbe11bd2aa7b580772 |
|
BLAKE2b-256 | 755f7a730a71c7845eccab86968e3860f2575b539e278e632dd5e64d437faae3 |