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.
- 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
Clone the repository and set up the environment using conda:
conda env create --file condaenv.yml
conda activate condaenvcd src
python run.pycd src
python run.py --batch_size 80 --lr 2e-5| 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 |
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.
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}
}