# jadecurl/predicting-viral-rumors-and-vulnerable-users architecture

> Architecture diagram of the GitHub repository jadecurl/predicting-viral-rumors-and-vulnerable-users, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jadecurl/predicting-viral-rumors-and-vulnerable-users
- Repository: https://github.com/jadecurl/predicting-viral-rumors-and-vulnerable-users

## Overview

##### Project Type and Purpose
- This project is a research/code implementation of a multi-task learning framework based on graph neural networks (GNNs). The goal is to jointly learn rumor detection, virality scoring, and user vulnerability scoring.
- The README makes it clear that the system processes datasets (derived from TWITTER and WEIBO), performs graph-based pre-processing, trains a unified model (via hierarchical graph pooling), and provides an inference interface.

##### Analyzing the File Structure
- Top-Level Files:
– README.md: Contains project overview, architecture references, and usage instructions.
– requirements.txt: Lists dependencies required for the project (likely including PyTorch, DGL, etc.).
– run.py: The main execution script for training or inference.
– run_func.py: Likely contains additional runtime functions or helper routines for model execution.
– model.py: Houses the model definition(s) and maybe the multi-task learning implementation.
– dgl_format.py: Responsible for converting raw or processed data into a format suitable for DGL (Deep Graph Library) models.
– utils.py: Contains utility functions, possibly for logging, metrics, or other common functionalities.
- Folders:
– datasets: Contains the dataset along with its own README explaining its source and modifications.
– pics: Holds visual materials, including a PDF (model.pdf) that likely represents the multi-task model architecture from the paper.

##### Identifying Main Components
A. Data Layer
– Datasets: Source data (TWITTER/WEIBO) stored in the datasets folder; note the additional labels (rumor, virality, vulnerability).
– Data Preprocessing: The dgl_format.py script is responsible for converting data into the DGL-compatible format.
B. Model and Learning Component
– Model Module: model.py contains the implementation of the unified multi-task GNN model.
– Multi-task Framework: Represent the three tasks (rumor detection, virality scoring, vulnerability scoring) possibly as sub-components inside the model.
C. Execution/Orchestration Component
– Main Runner: run.py controls the training/inference flow.
– Auxiliary Execution: run_func.py for supporting functions or alternative workflows.
D. Utilities and Helper Functions
– utils.py: Provides common functions and possibly logging, instrumentation, or metric calculations.
E. External Dependencies and Libraries

##### Mapping Relationships and Interactions
- Flow is likely sequential from data ingestion → preprocessing → model training → inference.
- The run.py script serves as the orchestrator connecting preprocessing, model training, and inference; it interacts with run_func.py and utils.py.
- To indicate how external frameworks (like DGL and potentially PyTorch) are integrated with the model.

##### Architectural Patterns and Design Principles
- Modular Design: Separate modules for data handling, pre-processing, the core model, and utilities reinforce code reusability and separation of concerns.
- Multi-task Learning: Highlight that the model is designed to learn shared representations for three distinct but related tasks.

##### Additional Notes
- Be very detailed—each component should be distinctly represented to capture the end-to-end workflow, from raw data to model output.
- Reference the provided model.pdf (in the pics folder) if it helps inform more detailed sub-components or internal structure of the model architect.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Data Layer
    subgraph "Data Layer"
        A["Data Inputs"]:::data
    end

    %% Preprocessing Layer
    subgraph "Preprocessing Layer"
        B["Data Preprocessing"]:::preprocessing
    end

    %% Model Layer
    subgraph "Model Layer"
        C["Model Architecture"]:::model
        subgraph "Multi-task Components"
            C1["Rumor Detection Task"]:::model
            C2["Virality Scoring Task"]:::model
            C3["Vulnerability Scoring Task"]:::model
        end
    end

    %% Execution Layer
    subgraph "Execution Layer"
        D["Main Runner"]:::execution
        E["Auxiliary Execution"]:::execution
        F["Utilities"]:::utility
    end

    %% External Layer
    subgraph "External Layer"
        G["External Dependencies (DGL, PyTorch)"]:::external
        H["Documentation"]:::external
    end

    %% Connections
    A -->|"ingests"| B
    B -->|"formatsData"| C
    C -->|"trainsInfers"| D
    D -->|"orchestrates"| E
    D -->|"utilizes"| F
    C -->|"integrates"| G
    C -->|"documentedBy"| H
    C -->|"contains"| C1
    C -->|"contains"| C2
    C -->|"contains"| C3

    %% Click Events
    click A "https://github.com/jadecurl/predicting-viral-rumors-and-vulnerable-users/tree/main/datasets/"
    click B "https://github.com/jadecurl/predicting-viral-rumors-and-vulnerable-users/blob/main/dgl_format.py"
    click C "https://github.com/jadecurl/predicting-viral-rumors-and-vulnerable-users/blob/main/model.py"
    click D "https://github.com/jadecurl/predicting-viral-rumors-and-vulnerable-users/blob/main/run.py"
    click E "https://github.com/jadecurl/predicting-viral-rumors-and-vulnerable-users/blob/main/run_func.py"
    click F "https://github.com/jadecurl/predicting-viral-rumors-and-vulnerable-users/blob/main/utils.py"
    click H "https://github.com/jadecurl/predicting-viral-rumors-and-vulnerable-users/blob/main/pics/model.pdf"

    %% Styles
    classDef data fill:#AED6F1,stroke:#2E86C1,stroke-width:2px;
    classDef preprocessing fill:#D6EAF8,stroke:#3498DB,stroke-width:2px;
    classDef model fill:#F5B7B1,stroke:#E74C3C,stroke-width:2px;
    classDef execution fill:#ABEBC6,stroke:#27AE60,stroke-width:2px;
    classDef utility fill:#FEF9E7,stroke:#F1C40F,stroke-width:2px;
    classDef external fill:#E8DAEF,stroke:#8E44AD,stroke-width:2px;
```
