Skip to content

nickprock/influencer

Repository files navigation

Influencer Centrality

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.


social-network


Image Credits


Installation

Dependencies

* Python >= 3.8.5
* PyTorch >= 1.10.2
* NumPy >= 1.20

User Installation

Option 1: Clone and install locally

  1. Clone or download .zip and unzip
  2. Using terminal go into the folder with setup.py
  3. Run the following command:
python setup.py install
  1. Test the installation:
import influencer
print(influencer.__version__)

Option 2: Install from GitHub

pip install git+https://github.com/nickprock/influencer.git

Current Implementation

The 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

Experimental Features

For experimental features including JAX and NumPy implementations, please check the experimental branch:

git clone https://github.com/nickprock/influencer.git
git checkout experimental

Features

The package includes the following centrality measures:

  • SocialAU: Multi-layer network approach for topic-authoritative user detection
  • HITS and TOPHITS: Hub and Authority scoring algorithms

Performance

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.

Testing

The package includes a comprehensive test suite to ensure reliability and correctness of the algorithms. Run tests with:

python -m pytest tests/

Citation

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}
}

Contributing

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.

Links

Have Fun!

License

The code present in this project is licensed under the MIT License.

Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.

About

Algorithm to find influencer in multilayer network.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages