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.

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

coordinationz-0.0.6-cp312-cp312-win_amd64.whl (49.5 kB view details)

Uploaded CPython 3.12 Windows x86-64

coordinationz-0.0.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (176.0 kB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

coordinationz-0.0.6-cp312-cp312-macosx_11_0_arm64.whl (93.4 kB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

coordinationz-0.0.6-cp312-cp312-macosx_10_9_x86_64.whl (100.0 kB view details)

Uploaded CPython 3.12 macOS 10.9+ x86-64

coordinationz-0.0.6-cp311-cp311-win_amd64.whl (49.5 kB view details)

Uploaded CPython 3.11 Windows x86-64

coordinationz-0.0.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (176.0 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

coordinationz-0.0.6-cp311-cp311-macosx_11_0_arm64.whl (93.4 kB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

coordinationz-0.0.6-cp311-cp311-macosx_10_9_x86_64.whl (99.9 kB view details)

Uploaded CPython 3.11 macOS 10.9+ x86-64

coordinationz-0.0.6-cp310-cp310-win_amd64.whl (49.5 kB view details)

Uploaded CPython 3.10 Windows x86-64

coordinationz-0.0.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (176.0 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

coordinationz-0.0.6-cp310-cp310-macosx_11_0_arm64.whl (93.4 kB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

coordinationz-0.0.6-cp310-cp310-macosx_10_9_x86_64.whl (99.9 kB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

coordinationz-0.0.6-cp39-cp39-win_amd64.whl (49.4 kB view details)

Uploaded CPython 3.9 Windows x86-64

coordinationz-0.0.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (176.0 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

coordinationz-0.0.6-cp39-cp39-macosx_11_0_arm64.whl (93.4 kB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

coordinationz-0.0.6-cp39-cp39-macosx_10_9_x86_64.whl (99.9 kB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

coordinationz-0.0.6-cp38-cp38-win_amd64.whl (49.4 kB view details)

Uploaded CPython 3.8 Windows x86-64

coordinationz-0.0.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (179.0 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

coordinationz-0.0.6-cp38-cp38-macosx_11_0_arm64.whl (95.4 kB view details)

Uploaded CPython 3.8 macOS 11.0+ ARM64

coordinationz-0.0.6-cp38-cp38-macosx_10_9_x86_64.whl (101.8 kB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

File details

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

File metadata

File hashes

Hashes for coordinationz-0.0.6-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 c3e056d51925c90748ac5c8f78614baeff3715e65f3e12d3a8fa9d2a1766d284
MD5 6f52e7e2a1b262495c597775f066883f
BLAKE2b-256 dfe6a9a9507adb479062eed817b89e54da12c8d557a48b7e969cc00428e182b1

See more details on using hashes here.

File details

Details for the file coordinationz-0.0.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for coordinationz-0.0.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 73d424366bf91ec0f4a2388cb54364e8889927349c10e791e3de5c52869b5211
MD5 f9af34e3f033a188089512223534f4cd
BLAKE2b-256 070691387c24c0b8fe569057ebc2591706d1df1ac2a9c2ffc7c94fa331db7a7b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for coordinationz-0.0.6-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c3f231f58141552d4b22fda52cbbcdb355378961e3401e2c0b598b66e9316759
MD5 c739d8cd02240ab879e099d270baff24
BLAKE2b-256 5eebb583e25de51fec4e43ab8963f37f86ac82c6466f6f03f7d14e8b10e82d70

See more details on using hashes here.

File details

Details for the file coordinationz-0.0.6-cp312-cp312-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for coordinationz-0.0.6-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 1bfef1c396705f3e4e481bfb7c9957c80ada16556d611fdd4810afb35613688c
MD5 49dee1cdd98992b861df94e27c5cd1b0
BLAKE2b-256 3ed62bc28cdc7f8c11dfb067a07ea13c22266ba599bf91b66cd2c4d81ca44829

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for coordinationz-0.0.6-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 b0b914aaf8dd58ef470aad4f7243d91ea6f9b97b6f894a732efa0e66a8563e6d
MD5 b1e115a94914c04a1404f094e1ae9b64
BLAKE2b-256 06672e417ebc7fbc2cd337d3d6b31303fb796b1a43c3ca9dc2f6d9a55d23c685

See more details on using hashes here.

File details

Details for the file coordinationz-0.0.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for coordinationz-0.0.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 64e90b7a2302ee0e4de9d179e621376152a98d0f59d6d2fa426191a7cd04454c
MD5 9b3078f099c9ce63ce10785c3adc1439
BLAKE2b-256 37be273fb959162f9b6d9ea46de8dea623a7b754b7b53455ebbf6140a5d34915

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for coordinationz-0.0.6-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 94c33cba930f65b8c792e830fc2ddb11adc3e549c9dfea9c487ff5a8a0f4b949
MD5 4720811a9463640f7652b2c49825a07c
BLAKE2b-256 6f1ca65478cd46fadf44539edc312c59c5ccb0b8b23325a9b78eb3389142cad7

See more details on using hashes here.

File details

Details for the file coordinationz-0.0.6-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for coordinationz-0.0.6-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 4538c10c3f71e52aa8c06f977d74b99a397b9282adb64431091db3472e77f605
MD5 82c38c4dd349687b893b1ae40455de2d
BLAKE2b-256 81671c9d40fbb0ef56cf755792e9274892d1535fdcffca23fca306bbf13d1bdb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for coordinationz-0.0.6-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 3165f393b28ad506cc782ee3345cc40bc43065b305509a6284820638af6ffe35
MD5 4632005233bbb7b89df12aaa22f6a1b0
BLAKE2b-256 c4765449af50785f987c5412c7a58efacb509fd6bd1a2ee833279ee3bfc49f2d

See more details on using hashes here.

File details

Details for the file coordinationz-0.0.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for coordinationz-0.0.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d17fb7df72286aa4d8bd0ec10bc8af4c023371eeee15913f35a13a5e4877a72c
MD5 f45f767b25c5bcfd81870587032c4f55
BLAKE2b-256 4c01064beac26ff30c69cc36266b1e2fcc363bb1b4aca2c939747eda1baefd55

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for coordinationz-0.0.6-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b14a8f4851a43d9f879cc33fc982f7362a8f66dc160a9fe8bf406d299994e625
MD5 fbfb4187c71fe3244e7bf6ec6e24557a
BLAKE2b-256 f6bd915ecff3fd5693743b7a7e450507ede26402688ae4838f084f44ed44a962

See more details on using hashes here.

File details

Details for the file coordinationz-0.0.6-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for coordinationz-0.0.6-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 bbbf9ba59726e52b09ab041a9d2225fa6c80303004cc1e71d441052f80f83f59
MD5 a4d22d686ae51aa6f28bd9b14c024100
BLAKE2b-256 558e1256410c9f35286a16234763fa108a8485f35c03e9b5abf352223478d25b

See more details on using hashes here.

File details

Details for the file coordinationz-0.0.6-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for coordinationz-0.0.6-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 cb312e13f6c663af442ed11dad84c06536e504be77d9052c118ffcda3671fe9c
MD5 fbc2f9c3fb84bb0f1d8692cdafc92713
BLAKE2b-256 90dee6b56ce4da6768b76bf606b01cb65cb2b660a48116697e9172028c69a444

See more details on using hashes here.

File details

Details for the file coordinationz-0.0.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for coordinationz-0.0.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1fd86553d803e5c157ae6d0064f5d2099041795e97180e71f89b77f8c6777e60
MD5 5793f2e19132d929035545f51b9cf5ce
BLAKE2b-256 c4059173d4724c77138f6eb8b7cb5b2812601142eb7e3a4f59c67c9382bd7120

See more details on using hashes here.

File details

Details for the file coordinationz-0.0.6-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for coordinationz-0.0.6-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 dc6b93df4251ba2416f5ce3fd39fb3f596e83a8074f7522b90954cd0eb46e9fb
MD5 5c1dcdbb146b66c8455ac621e66a8c7d
BLAKE2b-256 fc7c0b8aa2cc8b7b1b2430e0c682fe370ed26db784d7733cfec85a7c0c9dcca3

See more details on using hashes here.

File details

Details for the file coordinationz-0.0.6-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for coordinationz-0.0.6-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 8f955373fa8bdbb0890ba6da70f326e3dd105d4569e147c8ecf277486a509045
MD5 0a3233f65e6986c85219db78319b8eb7
BLAKE2b-256 7483a599442f8f8b7e73c09d3220e79735ee9a96932e0ed1e7f7a27b032148b7

See more details on using hashes here.

File details

Details for the file coordinationz-0.0.6-cp38-cp38-win_amd64.whl.

File metadata

File hashes

Hashes for coordinationz-0.0.6-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 039e1b0c5c9fa42ec1de4969aab1e2cbcd805e1c62d73b3b54b9d6841a37405b
MD5 f13f78b29f531dbdd78a5e11934f91e7
BLAKE2b-256 5732e079aa2181f49e9f2ecfd6aa4256c74ee6571ee1d38310554320469dd5d8

See more details on using hashes here.

File details

Details for the file coordinationz-0.0.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for coordinationz-0.0.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a9bab4bc33278d87fb466a57aeef7f5527e27469c124cd8628a93d843f647bd3
MD5 de875b8852a32af4b46f69b23f90400c
BLAKE2b-256 54e5f1fbaf270f1dbb129183264c57393163479db923357cab2edcadfb4e2901

See more details on using hashes here.

File details

Details for the file coordinationz-0.0.6-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for coordinationz-0.0.6-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 aaecc0a334fc5f2c83169e1149943b26f3200d3d2f8915882a8dd54ee150c58a
MD5 11b7cb33c6cc7d9a200e91cd1a5211c1
BLAKE2b-256 0da118ab6b25f9472ce2c2651ed2c2a368dcc66bc3a837037b73c8f2fc9d223a

See more details on using hashes here.

File details

Details for the file coordinationz-0.0.6-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for coordinationz-0.0.6-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 21acb3569c32f3391ad5dfad8e22c05c7defb8ac8a1f6c37de6ea63044ee446f
MD5 35eaf0abe3a38ba511aa1ce72291f4df
BLAKE2b-256 978c3d07f8e18369ec8f30aaf40b867fd2eee3b9d23ac9c353e24040440a5def

See more details on using hashes here.

Supported by

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