The algorithm in this package is inspired by the paper "Detecting Topic Authoritative Social Media Users: a Multilayer Network Approach".
In this paper, the authors propose a method capable of finding influential users by exploiting the contents of the messages posted by them to express opinions on items, by modeling these contents with a three-layer network.
The full paper and other materials are available on ICAR-CNR website.
This package provides a PyTorch-based implementation of the SocialAU algorithm for efficient tensor calculations.
* Python >= 3.8.5
* PyTorch >= 1.10.2
* NumPy >= 1.20
Option 1: Clone and install locally
- Clone or download .zip and unzip
- Using terminal go into the folder with setup.py
- Run the following command:
python setup.py install- Test the installation:
import influencer
print(influencer.__version__)Option 2: Install from GitHub
pip install git+https://github.com/nickprock/influencer.gitThe current main branch contains a stable PyTorch-based implementation focused on:
- SocialAU algorithm for detecting influential users
- HITS and TOPHITS centrality measures
- Comprehensive test suite
- Optimized performance for large-scale networks
For experimental features including JAX and NumPy implementations, please check the experimental branch:
git clone https://github.com/nickprock/influencer.git
git checkout experimentalThe package includes the following centrality measures:
- SocialAU: Multi-layer network approach for topic-authoritative user detection
- HITS and TOPHITS: Hub and Authority scoring algorithms
The PyTorch implementation provides excellent performance characteristics:
- Scalability: Works efficiently up to 10^9 nodes
- Memory efficiency: Optimized tensor operations
- Cross-platform compatibility: Works on Windows, Linux, and macOS
For detailed performance comparisons between different implementations (JAX, NumPy, PyTorch), refer to the experimental branch and the Google Colab notebook.
Additional tests and examples are available in the notebook directory.
The package includes a comprehensive test suite to ensure reliability and correctness of the algorithms. Run tests with:
python -m pytest tests/If you use this code in your research, please cite this project:
@misc{influencer-centrality,
author = {Nicola Procopio},
title = {Influencer Centrality},
howpublished = {\url{https://github.com/nickprock/influencer}},
year = {2020}
}and the original paper:
@article{oro2017detecting,
title={Detecting topic authoritative social media users: a multilayer network approach},
author={Oro, Ermelinda and Pizzuti, Clara and Procopio, Nicola and Ruffolo, Massimo},
journal={IEEE Transactions on Multimedia},
volume={20},
number={5},
pages={1195--1208},
year={2017},
publisher={IEEE}
}Contributions are welcome! Please feel free to submit issues, feature requests, or pull requests.
For experimental features or alternative implementations, consider contributing to the experimental branch.
Have Fun!
The code present in this project is licensed under the MIT License.
This work is licensed under a Creative Commons Attribution 4.0 International License.

