Git Product home page Git Product logo

echo-chamber-detection's Introduction

Update: Use this colab notebook to reproduce our results

If you use this code or part of it, please cite the original reference:

Minici, M., Cinus, F., Monti, C., Bonchi, F., & Manco, G. (2022, October). Cascade-based echo chamber detection. In Proceedings of the 31st ACM International Conference on Information & Knowledge Management (pp. 1511-1520). doi: https://doi.org/10.1145/3511808.3557253


Before running any experiment, we suggest you install the provided conda environment.

How to install the conda environment: conda env create --file environment.yml

Running an experiment

In both sections, the parameters highlighted in bold are the ones you should modify in order to fully reproduce our results.

Synthetic Experiments

In order to run a synthetic experiment, you can use python grid-synthetic.py if you want to use default settings, otherwise, you can specify several options:

  • seed, to change the initial random seed for stochasticity;
  • N, to change the number of initial users;
  • eta, to change the polarity of each community;
  • s, to change the social prior size;
  • h, to change the echo-chamber prior size;
  • B, you can ignore this parameter;
  • items_per_node, to change the number of items per user;
  • lr, learning rate of ECD procedure;
  • epochs, number of epochs of ECD procedure;
  • oversampling, whether you want to oversample the minority class --- either edges or propagations;
  • reweighting, whether you want to reweight the two classes w.r.t. their cardinality;
  • annealing, whether you want to add an annealing procedure;
  • ablation, whether you want to exclude links or propagations from the ECD procedure;
  • training_type, you can ignore this parameter;
  • model_type, you can ignore this parameter;
  • device, whether you want the experiment to be run on GPU. If no GPU is available, then pass an empty string.

Real-World Experiments

In order to run a synthetic experiment, you can use python grid-real.py if you want to use default settings, otherwise, you can specify several options:

  • seed, to change the initial random seed for stochasticity;
  • dataset, to change the dataset to analyze. Pick one between brexit and vaxNoVax.
  • K, to change the number of communities you want to find;
  • s, to change the social prior size;
  • h, to change the echo-chamber prior size;
    • B, you can ignore this parameter;
  • lr, learning rate of ECD procedure;
  • epochs, number of epochs of ECD procedure;
  • oversampling, whether you want to oversample the minority class --- either edges or propagations;
  • reweighting, whether you want to reweight the two classes w.r.t. their cardinality;
  • annealing, whether you want to add an annealing procedure;
  • link_removal, you can ignore this parameter!
  • prop_removal, whether you want to exclude some propagations from the dataset;
  • prop_removal_perc, the percentage of propagations you want to remove;
  • stance_detection_exp, it is a boolean flag --- i.e.: True or False --- that when you want to analyze the stance detection capability of ECD if set to True, removes all propagations of the analyzed users.
  • ablation, whether you want to exclude links or propagations from the ECD procedure;
  • training_type, you can ignore this parameter;
  • model_type, you can ignore this parameter;
  • device, whether you want the experiment to be run on GPU. If no GPU is available, then pass an empty string.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.