How jadecurl/predicting-viral-rumors-and-vulnerable-users works
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.