Skip to main content

Package to create networks for detecting coordination in social media.

Project description

coordinationz

Collection of scripts and package to analyze coordination in social media data.

Supported Python versions: 3.10 to 3.12.

To install the package, download the git repository and run the following command in the root directory:

pip install .

To install the package in development mode, run the following commands in the root directory:

pip install meson-python ninja numpy
pip install --no-build-isolation -e .

For debug mode, use the following command for local installation:

pip install --no-build-isolation -U -e . -Csetup-args=-Dbuildtype=debug

To debug the C code, use gdb:

gdb -ex=run -args python <python file>

Run for INCAS datasets (e.g., phase2a or phase2b)

First install the package as described above. The next step is setting up the config.toml file. You can use config_template.toml as a template.

cp config_template.toml config.toml

Setup the paths for the INCAS datasets and networks

# Location of jsonl files
INCAS_DATASETS = "/mnt/osome/INCAS/datasets" 

# Location where the preprocessed datasets will be stored
PREPROCESSED_DATASETS = "Data/Preprocessed"

#Logation of the outputs 
NETWORKS = "Outputs/Networks"
FIGURES = "Outputs/Figures"
TABLES = "Outputs/Tables"
CONFIGS = "Outputs/Configs"

The INCAS_DATASETS folder should contain the uncompressed jsonl files.

First, the files should be preprocessed. This can be done by running the following python script:

python pipeline/preprocess/preprocessINCAS.py <dataname>

where dataname is the name of the dataset, which correspondts to the <INCAS_DATASETS>/<dataname>.jsonl file. Together with the preprocessed data, the script will generate a .txt file with some information about the dataset.

The parameters of the indicators can be set in the config.toml file.

Currently, only co-hashtag, co-URL and co-retweets are supported.

To run the indicators, you can use the pipeline/indicators.py script by running the following command:

python pipeline/indicators.py <dataname>

where dataname is the name of the dataset and indicator is the indicator to be run.

You an add a suffix to the output files by adding the --suffix parameter:

python pipeline/indicators.py <dataname> --suffix <suffix>

if no suffix is provided, the a timestamp will be used as suffix.

Such a process will generate files in the output directories defined by NETWORKS, TABLES, and CONFIGS.

In particular, the TABLES folder will contain the suspicious pairs of users and clusters in CSV format.

The NETWORKS folder will contain the networks in xnet format. xnet format can be read by using the xnetwork package:

pip install xnetwork

and using the following code:

import xnetwork as xn
g = xn.load("network.xnet")

The result is an igraph network. You can convert it to the networkx format by using the following code:

network = g.to_networkx()

The config file used to generate the data will be copied to the "CONFIG" directory. A new section will be added to the config with extra parameters about the run.

Text similarity indicators

The text similarity indicators can be run by including usctextsimilarity, textsimilarity or coword to the indicator list. For instance pipeline/indicators.py <data_name> -i cohashtag coretweet courl textsimilarity. usctextsimilarity` and textsimilarity requires the instalation of packages faiss and sentence-transformers. GPU is recommended for performance.

Run for IO datasets

Repeat the same steps as for INCAS datasets, but set the IO_DATASETS variable in the config.toml file to the location of the IO datasets. Also, for preprocessing, use the pipeline/preprocess/preprocessIO.py script.

Submitted methodologies

To generate the results submmited for the evaluation datasets, use the following procedures:

First preprocess the dataset according to the preprocess instructions above.

For the UNION approach:

  • Copy the config_template_union.toml to config_union.toml and set the PATHS accordingly.
  • Run the following command:
python pipeline/indicators.py <dataname> -c config_union.toml -i cohashtag coretweet courl coword -s union

where <dataname> is the filename of the dataset (for the evaluation dataset it should be TA2_full_eval_NO_GT_nat_2024-06-03 or TA2_full_eval_NO_GT_nat+synth_2024-06-03).

  • The results will be stored in the Outputs/Tables (or the folder defined in the config file).

For the SOFTUNION approach:

  • Copy the config_template_softunion.toml to config_softunion.toml and set the PATHS accordingly.
  • Run the following command:
python pipeline/indicators.py <dataname> -c config_softunion.toml -i cohashtag coretweet courl coword -s softunion

where <dataname> is the filename of the dataset (for the evaluation dataset it should be TA2_full_eval_NO_GT_nat_2024-06-03 or TA2_full_eval_NO_GT_nat+synth_2024-06-03).

  • The results will be stored in the Outputs/Tables (or the folder defined in the config file).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

coordinationz-0.2.2-cp312-cp312-win_amd64.whl (51.3 kB view details)

Uploaded CPython 3.12Windows x86-64

coordinationz-0.2.2-cp312-cp312-manylinux_2_28_x86_64.whl (224.8 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

coordinationz-0.2.2-cp312-cp312-macosx_11_0_arm64.whl (95.5 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

coordinationz-0.2.2-cp311-cp311-win_amd64.whl (51.2 kB view details)

Uploaded CPython 3.11Windows x86-64

coordinationz-0.2.2-cp311-cp311-manylinux_2_28_x86_64.whl (224.6 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

coordinationz-0.2.2-cp311-cp311-macosx_11_0_arm64.whl (95.4 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

coordinationz-0.2.2-cp310-cp310-win_amd64.whl (51.2 kB view details)

Uploaded CPython 3.10Windows x86-64

coordinationz-0.2.2-cp310-cp310-manylinux_2_28_x86_64.whl (224.6 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

coordinationz-0.2.2-cp310-cp310-macosx_11_0_arm64.whl (95.4 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file coordinationz-0.2.2-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for coordinationz-0.2.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 ee62cb565e81d4b08f88cb8d22ed7903e60c5dbfcbc3c1ab55e7b9018062cf7c
MD5 b7620e9880e91c18d3e36c5bd478fad5
BLAKE2b-256 324d5949975ceef59410a86e40fe9f03ce84b8f62f932afa21a97a6c3e4d8d83

See more details on using hashes here.

Provenance

The following attestation bundles were made for coordinationz-0.2.2-cp312-cp312-win_amd64.whl:

Publisher: build-publish-pypi.yml on filipinascimento/coordinationz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file coordinationz-0.2.2-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for coordinationz-0.2.2-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 be2862928af48bb4d92e02bb8234b747f633e6ee66c556e3d44b985fcc504ac3
MD5 8d949127fd1f03b9b09bb51483cdc703
BLAKE2b-256 ed3bff8192fc838d1ed6eebe5fac60cb552406bc4e96f4fbea1a9e7ad902e862

See more details on using hashes here.

Provenance

The following attestation bundles were made for coordinationz-0.2.2-cp312-cp312-manylinux_2_28_x86_64.whl:

Publisher: build-publish-pypi.yml on filipinascimento/coordinationz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file coordinationz-0.2.2-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for coordinationz-0.2.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 12a8347737dc2bd1af62e2f2ea8bef1bc5a9f4feb9ffe764e6835e8356735bbe
MD5 30f8ba81f6fc23253c283fa796ff6e0a
BLAKE2b-256 d9295cba546e31c2253ea9c13598281a72f9788b00c8cac56a2671b3b368cb03

See more details on using hashes here.

Provenance

The following attestation bundles were made for coordinationz-0.2.2-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: build-publish-pypi.yml on filipinascimento/coordinationz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file coordinationz-0.2.2-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for coordinationz-0.2.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 74f953ca865aac2254b94574aeee7005fc16c77a4bfb7a42898d14e4c9f3869a
MD5 5f2aa83db94fbc7e8daffa509073ab07
BLAKE2b-256 4eb5fad6182d8caf9127bec58cee0be3fc2555b383922f06a28bcc7e1bdea700

See more details on using hashes here.

Provenance

The following attestation bundles were made for coordinationz-0.2.2-cp311-cp311-win_amd64.whl:

Publisher: build-publish-pypi.yml on filipinascimento/coordinationz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file coordinationz-0.2.2-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for coordinationz-0.2.2-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 936deb184ef011b22d2c23f06a8e04af5b48efe269b14ded73930751e5a0bea2
MD5 fede65e377e6d33e116bdd38cb63b0e7
BLAKE2b-256 dca1fa80eceadd3e732298aeaf08e3e9d2612fde0f394fab842953a72f96aa27

See more details on using hashes here.

Provenance

The following attestation bundles were made for coordinationz-0.2.2-cp311-cp311-manylinux_2_28_x86_64.whl:

Publisher: build-publish-pypi.yml on filipinascimento/coordinationz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file coordinationz-0.2.2-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for coordinationz-0.2.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6a6a56f8260a5824d7a9a282c6ae9ee402dfb9f83a9b07c87c28c727e675b1fb
MD5 497210616206f5f16514907f5e29b89a
BLAKE2b-256 2633ed0c3b2a82b8dd62ec6f18b0aeee8a2dbb7a9096bc0c08671a9f996447e1

See more details on using hashes here.

Provenance

The following attestation bundles were made for coordinationz-0.2.2-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: build-publish-pypi.yml on filipinascimento/coordinationz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file coordinationz-0.2.2-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for coordinationz-0.2.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 20cca31deb73a50be8142060f03269ea266edd8506f7ff486b9a0be29c7eb032
MD5 a0ab1aed3f7082bc5671719f8ce06898
BLAKE2b-256 bb26de2caa059c19a46c224309def53b104795d8035edd991879ae2f40bb9c56

See more details on using hashes here.

Provenance

The following attestation bundles were made for coordinationz-0.2.2-cp310-cp310-win_amd64.whl:

Publisher: build-publish-pypi.yml on filipinascimento/coordinationz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file coordinationz-0.2.2-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for coordinationz-0.2.2-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3cf3c1bd52e0dc0873fb0d7df131eb0cb61a7d451cf0bb83046f7bcaca166832
MD5 0d4a77221ff4e8b4dda0864321789617
BLAKE2b-256 c35ebff792654415c0d7e5f0e6324753935c42ceba5eae171a694952b54fa90b

See more details on using hashes here.

Provenance

The following attestation bundles were made for coordinationz-0.2.2-cp310-cp310-manylinux_2_28_x86_64.whl:

Publisher: build-publish-pypi.yml on filipinascimento/coordinationz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file coordinationz-0.2.2-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for coordinationz-0.2.2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9c95297b8a94d0ba7d25f0899e2421687523283d0bddbc68e11ee7c41ba00017
MD5 b82628ba00a4421585fc76a8f73ac1fd
BLAKE2b-256 64c7bcbba84286e1dc1d954c5ac1bca023935d2fbeb79a61f149825529b7bcd3

See more details on using hashes here.

Provenance

The following attestation bundles were made for coordinationz-0.2.2-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: build-publish-pypi.yml on filipinascimento/coordinationz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page