Skip to content
/ POLOR Public

[FLAIRS 2024] POLOR: Leveraging Contrastive Learning to Detect Political Orientation of Opinion in News Media

Notifications You must be signed in to change notification settings

alaaj27/POLOR

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📰 POLOR: Political Orientation Detection via Contrastive Learning

POLOR (POLitical ORientation) is a fine-tuned BERT-based model that leverages multi-objective contrastive learning to detect political bias in opinion pieces from news media. Unlike traditional models that learn to classify based on the source's signature, POLOR learns sentence-level and article-level representations that reflect true political orientation by contrasting content across diverse sources.

POLOR introduces multiple contrastive objectives—including Additive Attention and Unsupervised MinMax—to help disentangle source style from ideological content, achieving significantly better performance on human-annotated datasets.


📑 Table of Contents


🚀 Features

  • Multi-objective contrastive learning framework
  • Robust to source-level labeling noise
  • Predicts both sentence-level and article-level political orientation
  • Outperforms strong baselines on multiple benchmarks
  • Comes with source-annotated and human-annotated datasets

📦 Installation

Clone the repository and set up the environment using conda:

conda env create --file condaenv.yml
conda activate condaenv

🏋️‍♀️ Training

Run with default parameters:

cd src
python run.py

Run with custom parameters:

cd src
python run.py --batch_size 80 --lr 2e-5

Key arguments:

Argument Default Description
batch_size 80 Training batch size
triplet_size 5 Number of positive/negative samples
epochs 5 Number of training epochs
maxlen 80 Max sequence length
lr 2e-5 Learning rate
pooling "mean" Pooling strategy (mean or cls)
loss_objective "MMA" Loss objective (MMA, Additive, etc.)
alpha 0.25 Weight for additive attention loss
beta 0.25 Weight for MinMax loss
distance_norm 2 Norm type for distance metric
margin 1.0 Margin in contrastive loss
train_path ../data/train.csv Path to training data
test_path ../data/test.csv Path to testing data

📂 Dataset

POLOR is evaluated on:

  • A source-annotated dataset collected from AllSides.com
  • A human-annotated dataset via crowdsourcing, covering high-profile cases

Each dataset includes sentence- and paragraph-level labels for Liberal and Conservative orientations.


📄 Citation

If you use this work, please cite:

@inproceedings{jararweh2024polor,
  title={POLOR: Leveraging Contrastive Learning to Detect Political Orientation of Opinion in News Media},
  author={Jararweh, Ala and Mueen, Abdullah},
  booktitle={The International FLAIRS Conference Proceedings},
  volume={37},
  year={2024}
}

🔗 Resources

About

[FLAIRS 2024] POLOR: Leveraging Contrastive Learning to Detect Political Orientation of Opinion in News Media

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages