Downloads · 30 days
937
0% of all-time downloads
bucketresearch/politicalBiasBERT
politicalBiasBERT is a text classification model from bucketresearch. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as mit.
BERT finetuned on many examples of politically biased texts
Downloads · 30 days
937
0% of all-time downloads
All-time downloads
1.3M
Public
Parameters
108M
868 MB on disk
Likes
33
Public
Click a slice to open those files.
.bin433 MB · 50%
How the weights are stored.
F32108M · 100%
From the Hugging Face model README
BERT finetuned on many examples of politically biased texts
Paper and repository coming soon.
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
text = "your text here"
tokenizer = AutoTokenizer.from_pretrained("bert-base-cased")
model = AutoModelForSequenceClassification.from_pretrained("bucketresearch/politicalBiasBERT")
inputs = tokenizer(text, return_tensors="pt")
labels = torch.tensor([0])
outputs = model(**inputs, labels=labels)
loss, logits = outputs[:2]
# [0] -> left
# [1] -> center
# [2] -> right
print(logits.softmax(dim=-1)[0].tolist())
@inproceedings{baly2020we,
author = {Baly, Ramy and Da San Martino, Giovanni and Glass, James and Nakov, Preslav},
title = {We Can Detect Your Bias: Predicting the Political Ideology of News Articles},
booktitle = {Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP)},
series = {EMNLP~'20},
NOmonth = {November},
year = {2020}
pages = {4982--4991},
NOpublisher = {Association for Computational Linguistics}
}
@article{bucket_bias2023,
organization={Bucket Research}
title={Political Bias Classification using finetuned BERT model}
year={2023}
}