Giter Club home page Giter Club logo

hg-pd-model's Introduction

HG-PD-Model

This repository is the official implementation of the group polarization detection model proposed in our paper "Heterogeneous Graph-based Polarization Detection (HG-PD): a Model Balancing Crude Processing with Rich Semantics".

What is HG-PD and Why?

Previous studies examining the detection and analysis of online group polarization have primarily concentrated on the single data type, such as self-reported measures, texts and graph structure. Typically these approaches depict group polarization as two factions with opposing viewpoints. However, such methodologies encounter limitations when applied to entertainment topics. To fill this research gap, this paper proposes a novel self-supervised model, termed HG-PD, for polarization detection on online social media.

Leveraging a heterogeneous graph, the model integrates multiple data types. Subsequently, Graph Neural Networks are then utilized to learn the user nodes' representations, guided by MCR2 loss function, for the downstream clustering task. Utilizing a real-world dataset, our model adeptly discerns nuanced differences among users with similar stances, transcending the traditional dichotomy. Furthermore, ablation experiments demonstrate that incorporating multifaceted information enriches the semantic depth of the graph, thereby furnishing meaningful interpretations that facilitate group polarization detection.

Requirements

  • Python version: 3.10.13
  • All packages versions are listed in package_version.txt

Usage Instruction

  1. You can refer to Data_description.txt for more information about .csv .xlsx .pt and .npy files in our codes.
  2. Code files Include 2 types:
    • Python scripts .py for collecting Sina Weibo's data (Sina_crawl) and some model-training related functions
    • Jupyter files .ipyn for (a) data processing; (b) all experiments in paper; and (c) visualization for HG-PD (i.e., exp3)
    • All Jupyter files are in 2 language versions, i.e., Chinese and English, for better understanding :D
  3. Python scripts (.py)
    • Sina_crawl: Used for crawling the data we need from Sina weibo (You can use it for crawling other Sina Weibo posts)
    • userInter: HomoG-based model framework for exp2
    • mcr_HGPD: HG-PD model framework for exp3
    • mcrLoss: MCR2 loss function
    • augment: Data augmentation
    • other_func: Used for constructing membership matrix \Pi
    • savePara: Used for saving loss .csv and model states .pt
  4. Jupyter files (.ipynb)
    • Data_processing: Include all data processing steps for 3 experiments
    • K-Prototype: Inmplementation of exp1 in our paper; Results are saved in Train_record/KPrototype
    • Ablation: Implementation of exp2 with related visualizations in our paper; Training results are saved in Train_record/Ablation and visualizations in Visualization
    • Model: Implementation of exp3 in our paper; Results are saved in Train_record/Model
    • Analysis_visualize: Visualizations of exp3 in our paper; Figures are saved in Visualization
  5. About Train_record
    • We just put the best model state in Train_record folder rather than putting all .pt files (or otherwise that will be many many files...).
    • If you are interested in all files, I will put a Google Drive link here

Also feel free to post any issues via Github.

Contact

If you have any question on the code, feel free to contact [email protected] or zili7472.uni.sydney.edu.au.

hg-pd-model's People

Contributors

levia-mobius avatar

Stargazers

 avatar  avatar

Watchers

 avatar

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.