byshichen / chinese-whispers-python

An implementation of Chinese Whispers in Python.

Home Page:https://pypi.python.org/pypi/chinese-whispers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

Build Status PyPI version

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.

More usage examples are available in the sample notebook.

In case you require higher performance, please consider our Java implementation that also includes other graph clustering algorithms: https://github.com/nlpub/watset-java.

About

An implementation of Chinese Whispers in Python.

https://pypi.python.org/pypi/chinese-whispers

License:MIT License


Languages

Language:Jupyter Notebook 95.4%Language:Python 4.6%